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

Uploaded Source

Built Distributions

django_chunkator-1.0.1-py2-none-any.whl (4.8 kB view details)

Uploaded Python 2

django-chunkator-1.0.1.linux-x86_64.tar.gz (3.4 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-chunkator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 033b89a6e771696192d4267eb836dfb0a3bf4885665094aa259710065447301b
MD5 ae926f83b7f2d4b33537b265904df711
BLAKE2b-256 a1227c600e18bdbc6f0ef935738714d128422362a3d36986dd8546284d2c2c51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_chunkator-1.0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 914b5d3067197509a57c79f6af3ead948cd35307042b0df3d662233af7859e74
MD5 72e89cafbb0fc5a578611d4982ceb414
BLAKE2b-256 a5bd9bbbd173ef7799b7c5b2d3f4f5c68774935a0ac2f67bbad0e73491f6cb09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django-chunkator-1.0.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 187b1aea383dca17f4cab43961ccf55e7a131765dbea18206aefce3e78e296b1
MD5 f89b8297857c5909253a72a5e29d62f0
BLAKE2b-256 890debe4739a95e613183ab91cd4c8f03a26394f57aa3abf32810fdcd9fe1bdb

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