Giter VIP home page Giter VIP logo

django-usda's Introduction

django-usda

Overview

django-usda imports and maps the USDA National Nutrient Database for Standard Reference (SR22) to Django models.

Requirements

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

Installation

  1. Copy the usda folder to a location available on your PYTHONPATH.
  2. Add 'usda' to INSTALLED_APPS in settings.py
  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:

./manage.py import_sr22

The above assumes that the sr22.zip 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.

Notes

The USDA National Nutrient Database for Standard Reference (SR22) can be found here: http://www.ars.usda.gov/Services/docs.htm?docid=18879.

License

See attached LICENSE.

Questions, Comments, Concerns:

Feel free to open an issue here: http://github.com/notanumber/django-usda/issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.