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

Uploaded Source

Built Distribution

django_chunkator-1.0.0-py2-none-any.whl (4.6 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django-chunkator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a9b386836825d58ecc038efd95c2f72adbcbf9461b8af49e786d2aa512b97142
MD5 87e12575dec06d6d18dc71b825912e5f
BLAKE2b-256 2f65c2f87fe01d3d362211330e427b82ea82585a72bbe6c602a73083ea6c8ace

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_chunkator-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 96ff34628b650afe7424870ded1281cab85f8b2283453c7e72335a9c7b1ac6c3
MD5 c8394c18b9b1e79d987c8940afb50fca
BLAKE2b-256 e7112bff962272d820ed573a23deddb1c6064a0e367ad469fe0b32439ed3cc7e

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