Update README

This commit is contained in:
Lucidiot 2019-10-23 08:50:08 +02:00
parent 00a49b01f7
commit 6920e0fb61
Signed by: lucidiot
GPG Key ID: 3358C1CA6906FB8D
3 changed files with 45 additions and 33 deletions

View File

@ -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)
```

43
README.rst Normal file
View File

@ -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/

View File

@ -13,7 +13,7 @@ setup(
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
package_data={
'': ['*.md', 'LICENSE', 'README'],
'': ['*.rst', 'LICENSE', 'README'],
},
install_requires=read_requirements('requirements.txt'),
python_requires='>=3.4',
@ -22,7 +22,7 @@ setup(
},
license='GNU General Public License 3',
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',
keywords="api usda nutrition food",
url="https://gitlab.com/Lucidiot/python-usda",