Skip to main content

Django json datadump object filtering

Project description

Django’s dumpdata management command allows you to dump objects from a given application, but sometimes you’ll want to extract all objects of a given model from a much larger file containing objects from many models.

This package provides the jsonfilter.py commandline utility, which will allow you to do just that.

Ultimately the idea would be to also add options to be able to search on different model fields to extract the objects you want before importing them again into the database.

Although it loads the entire json in memory, it’s actually quite fast. On a 41.6MB json file containing 131515 objects, it takes about 3s to extract 10341 objects of a given type. The 3s is actually fairly constant, however many objects there are of the model it’s extracting.

See jsonfilter.py --help for usage.

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-jsonfilter-0.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

django-jsonfilter-0.1.linux-i686.exe (65.2 kB view hashes)

Uploaded Source

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