Update README
This commit is contained in:
parent
00a49b01f7
commit
6920e0fb61
31
README.md
31
README.md
|
@ -1,31 +0,0 @@
|
||||||
# python-usda
|
|
||||||
|
|
||||||
python-usda is a fork of [pygov](https://pypi.org/project/pygov/) focused on [USDA's Food Composition Database API](http://ndb.nal.usda.gov/ndb/doc/). Browse full documentation on [Read the Docs](https://python-usda.readthedocs.io/en/latest)
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```
|
|
||||||
pip install python-usda
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
``` 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)
|
|
||||||
```
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
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/
|
4
setup.py
4
setup.py
|
@ -13,7 +13,7 @@ setup(
|
||||||
packages=find_packages(
|
packages=find_packages(
|
||||||
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
|
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
|
||||||
package_data={
|
package_data={
|
||||||
'': ['*.md', 'LICENSE', 'README'],
|
'': ['*.rst', 'LICENSE', 'README'],
|
||||||
},
|
},
|
||||||
install_requires=read_requirements('requirements.txt'),
|
install_requires=read_requirements('requirements.txt'),
|
||||||
python_requires='>=3.4',
|
python_requires='>=3.4',
|
||||||
|
@ -22,7 +22,7 @@ setup(
|
||||||
},
|
},
|
||||||
license='GNU General Public License 3',
|
license='GNU General Public License 3',
|
||||||
description="A fork of pygov focused on USDA nutritional database API",
|
description="A fork of pygov focused on USDA nutritional database API",
|
||||||
long_description=open('README.md').read(),
|
long_description=open('README.rst').read(),
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
keywords="api usda nutrition food",
|
keywords="api usda nutrition food",
|
||||||
url="https://gitlab.com/Lucidiot/python-usda",
|
url="https://gitlab.com/Lucidiot/python-usda",
|
||||||
|
|
Reference in New Issue