Skip to main content

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

Project description

Chunk large querysetsinto 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)

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-0.0.4.tar.gz (2.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-chunkator-0.0.4.tar.gz
Algorithm Hash digest
SHA256 306af80e73e76034efb3f751983db9b3402d126303785b388cbd4d9d4ea9e15a
MD5 cd010fddba8eae778ffcdffd27322ca8
BLAKE2b-256 88203e33f2aad772d2aafe1ad4b67cd9ea2efba503eb1495f0ff10ce687ba194

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