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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file django-chunkator-1.1.0.tar.gz
.
File metadata
- Download URL: django-chunkator-1.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad039bcbfdd61825ed5e0ab585714841eb28f221b3a08db5d6d22a168417eb1 |
|
MD5 | 6cd4bad207485a8cc31d5e2fbfe9a14b |
|
BLAKE2b-256 | b41ec3eada3b4f6d39a505beb67e1d1aeb39c4296e945ad02584fefe2f080442 |
File details
Details for the file django_chunkator-1.1.0-py2-none-any.whl
.
File metadata
- Download URL: django_chunkator-1.1.0-py2-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06163a27d77152717b6c608d75e02030e4f1e5d2b23c8d5a67a0267d0d8cb97e |
|
MD5 | 465eeaae6b9170cfa8c518a1128710de |
|
BLAKE2b-256 | e91455e0abcf76546772fa2449509256da2886f67a52a3e4025b74b42b08bab6 |
File details
Details for the file django-chunkator-1.1.0.linux-x86_64.tar.gz
.
File metadata
- Download URL: django-chunkator-1.1.0.linux-x86_64.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1ec4f1174ddd222b6f7f927e419d202a4cffcb68bab6dba135c14c477190a53 |
|
MD5 | fd5a9f60f4659be4316ddc4eee121f36 |
|
BLAKE2b-256 | 91ef0d6c20a90540dd28eb1f0502184bf2fdc9bcbdea3ac84b3fedc1cef1adec |