Skip to main content

Chunk large QuerySets into small chunks, and iterate over them without killing your RAM.

Project description

Chunk large QuerySets into small chunks, and iterate over them without killing your RAM.

https://travis-ci.org/novafloss/django-chunkator.svg

Usage

from chunkator import chunkator
for item in chunkator(LargeModel.objects.all(), 200):
    do_something(item)

This tool is intended to work on Django querysets.

Your model must define a pk field (this is done by default, but sometimes it can be overridden) and this pk has to be unique. django- chunkator has been tested with PostgreSQL and SQLite, using regular PKs and UUIDs as primary keys.

You can also use values():

from chunkator import chunkator
for item in chunkator(LargeModel.objects.values('pk', 'name'), 200):
    do_something(item)

License

MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-chunkator-1.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distributions

django_chunkator-1.1.0-py2-none-any.whl (4.7 kB view details)

Uploaded Python 2

django-chunkator-1.1.0.linux-x86_64.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file django-chunkator-1.1.0.tar.gz.

File metadata

File hashes

Hashes for django-chunkator-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bad039bcbfdd61825ed5e0ab585714841eb28f221b3a08db5d6d22a168417eb1
MD5 6cd4bad207485a8cc31d5e2fbfe9a14b
BLAKE2b-256 b41ec3eada3b4f6d39a505beb67e1d1aeb39c4296e945ad02584fefe2f080442

See more details on using hashes here.

File details

Details for the file django_chunkator-1.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for django_chunkator-1.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 06163a27d77152717b6c608d75e02030e4f1e5d2b23c8d5a67a0267d0d8cb97e
MD5 465eeaae6b9170cfa8c518a1128710de
BLAKE2b-256 e91455e0abcf76546772fa2449509256da2886f67a52a3e4025b74b42b08bab6

See more details on using hashes here.

File details

Details for the file django-chunkator-1.1.0.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for django-chunkator-1.1.0.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 c1ec4f1174ddd222b6f7f927e419d202a4cffcb68bab6dba135c14c477190a53
MD5 fd5a9f60f4659be4316ddc4eee121f36
BLAKE2b-256 91ef0d6c20a90540dd28eb1f0502184bf2fdc9bcbdea3ac84b3fedc1cef1adec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page