Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Import and map the USDA National Nutrient Database for Standard Reference (SR22) to Django models using MongoDB with mongoengine

Project Description


django-usda-mongo imports and maps the USDA National Nutrient Database for Standard Reference (SR22) to Django models using MongoDB with mongoengine. It also integrate django-mongonaut to admin the MongoDB database.


  • Python 2.5.x
  • Django 1.2.x (import_sr22 will not work with early versions)
  • mongoengine
  • django-mongonaut


  1. pip install django-usda-mongo or copy the usda_mongo folder to a location available on your PYTHONPATH.
  2. Add ‘usda’ to INSTALLED_APPS in
  3. Optionally, add (r’^usda/’, include(‘usda.urls’)), to your urlpatterns.

Data Import

To import the latest SR22 data. Simply use the import_sr22 management command as follows:

./ import_sr22

The above assumes that the file is in the current folder. To specify an alternative location specify -f <filename>.

The import_sr22 command takes several options:

  • –database <dbname> – Specify an alternative database to populate.
  • –food – Create/update all foods.
  • –group – Create/Update food groups.
  • –nutrient – Create/Update nutrients.
  • –weight – Create/Update weights.
  • –footnote – Create/Update footnotes.
  • –datasource – Create/Update data sources.
  • –derivation – Create/Update data derivations.
  • –source – Create/Update sources.
  • –data – Create/Update nutrient data.’
  • –all – Create/Update all data.

All of the above options can be combined to only create/update the desired data. If no options are specified, -all is assumed.

Also note that all data is loaded in a single transaction to ensure that database consistency is maintained.


The USDA National Nutrient Database for Standard Reference (SR22) can be found here:


0.1.0 (2015-03-31)

  • First release on PyPI.

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(14.6 kB) Copy SHA256 Hash SHA256
Wheel 2.7 May 21, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting