A fork of pygov, refreshed and focused only on USDA NDB API
This repository has been archived on 2022-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Lucidiot 35dcbaba20
Bump to 0.4.6
2019-10-23 20:19:14 +02:00
docs Update docs 2019-10-23 20:16:48 +02:00
usda Update docs 2019-10-23 20:16:48 +02:00
.codeclimate.yml Set up CodeClimate 2018-04-15 22:36:10 +02:00
.gitignore Add gitignore 2018-04-13 15:02:13 +02:00
.gitlab-ci.yml Add doc8 2019-07-06 20:25:45 +02:00
LICENSE Update LICENSE 2018-04-13 14:59:10 +02:00
README.rst Fix doc8 2019-10-23 08:53:19 +02:00
VERSION Bump to 0.4.6 2019-10-23 20:19:14 +02:00
requirements-dev.txt Allow setup.py test to run pytest 2019-10-23 20:01:38 +02:00
requirements.txt Drop Python 3.3 support 2018-07-12 08:41:22 +02:00
setup.cfg Allow setup.py test to run pytest 2019-10-23 20:01:38 +02:00
setup.py Update README 2019-10-23 08:50:08 +02:00

README.rst

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. Have a look at the documentation!

Setup

pip install python-usda

Usage

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)