Skip to main content

A fork of pygov focused on USDA nutritional database API

Project description

python-usda

⚠️ Since October 1, 2019, the APIs this package relies on have been deprecated. python-usda 1.x will remove those APIs and rely on the new Food Data Central_ APIs.

python-usda is a fork of pygov_ focused on USDA's Food Composition Database API <usda>. Have a look at the documentation!

Setup

::

pip install python-usda

Usage

.. code:: python

from usda.client import UsdaClient

client = UsdaClient("YOUR_API_KEY") foods = client.list_foods(5)

for food in foods: print(food.name)

Result::

Abiyuch, raw Acerola juice, raw Acerola, (west indian cherry), raw Acorn stew (Apache) Agave, cooked (Southwest)

.. _Food Data Central: https://fdc.nal.usda.gov/api-guide.html .. _pygov: https://pypi.org/project/pygov/ .. _usda: http://ndb.nal.usda.gov/ndb/doc/ .. _documentation: https://lucidiot.gitlab.io/python-usda/

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

python-usda-0.4.6.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

python_usda-0.4.6-py3-none-any.whl (24.3 kB view hashes)

Uploaded Python 3

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