Update docs
This commit is contained in:
parent
3a9534ae9b
commit
d0f2c57282
53
docs/api.rst
53
docs/api.rst
|
@ -17,32 +17,48 @@ Domain
|
||||||
Base classes
|
Base classes
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
.. automodule:: usda.domain
|
.. autoclass:: usda.domain.UsdaObject
|
||||||
:members: UsdaObject, ListItem
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: usda.domain.ListItem
|
||||||
|
:members:
|
||||||
|
|
||||||
Items
|
Items
|
||||||
^^^^^
|
^^^^^
|
||||||
|
|
||||||
.. automodule:: usda.domain
|
.. autoclass:: usda.domain.Food
|
||||||
:members: Food, Nutrient, Measure
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: usda.domain.Nutrient
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: usda.domain.Measure
|
||||||
|
:members:
|
||||||
|
|
||||||
Food Reports
|
Food Reports
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
.. automodule:: usda.domain
|
.. autoclass:: usda.domain.FoodReport
|
||||||
:members: FoodReport, FoodReportV2, Source
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: usda.domain.FoodReportV2
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: usda.domain.Source
|
||||||
|
:members:
|
||||||
|
|
||||||
Nutrient Reports
|
Nutrient Reports
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. automodule:: usda.domain
|
.. autoclass:: usda.domain.NutrientReportFood
|
||||||
:members: NutrientReportFood
|
:members:
|
||||||
|
|
||||||
Enums
|
Enums
|
||||||
-----
|
-----
|
||||||
|
|
||||||
.. automodule:: usda.enums
|
.. automodule:: usda.enums
|
||||||
:members: UsdaUriActions, UsdaNdbListType, UsdaNdbReportType
|
:members: UsdaUriActions, UsdaNdbListType, UsdaNdbReportType,
|
||||||
|
UsdaNdbDataSource
|
||||||
|
|
||||||
Low level classes
|
Low level classes
|
||||||
-----------------
|
-----------------
|
||||||
|
@ -50,15 +66,24 @@ Low level classes
|
||||||
Base client
|
Base client
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
||||||
.. automodule:: usda.base
|
.. autodata:: usda.base.BASE_URI
|
||||||
:members: BASE_URI, DataGovClientBase, api_request
|
|
||||||
|
.. autoclass:: usda.base.DataGovClientBase
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autofunction:: usda.base.api_request
|
||||||
|
|
||||||
Exceptions
|
Exceptions
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
||||||
.. automodule:: usda.base
|
.. autoexception:: usda.base.DataGovApiError
|
||||||
:members: DataGovApiError, DataGovApiRateExceededError,
|
:members:
|
||||||
DataGovInvalidApiKeyError
|
|
||||||
|
.. autoexception:: usda.base.DataGovApiRateExceededError
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoexception:: usda.base.DataGovInvalidApiKeyError
|
||||||
|
:members:
|
||||||
|
|
||||||
Pagination
|
Pagination
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
|
@ -71,6 +71,14 @@ nutritional data for some pseudo-scientific calculations in the
|
||||||
`PseudoScience <https://gitlab.com/Lucidiot/PseudoScience>`_ project
|
`PseudoScience <https://gitlab.com/Lucidiot/PseudoScience>`_ project
|
||||||
but has been extended to provide a better coverage of the API.
|
but has been extended to provide a better coverage of the API.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
.. _Food Data Central: https://fdc.nal.usda.gov/api-guide.html
|
||||||
|
|
||||||
Setup
|
Setup
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,10 @@ class UsdaNdbReportType(Enum):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
full = "f"
|
full = "f"
|
||||||
"""Contains all the available nutrients"""
|
"""
|
||||||
|
Contains all the available nutrients.
|
||||||
|
Only available on Standard Reference items.
|
||||||
|
"""
|
||||||
|
|
||||||
stats = "s"
|
stats = "s"
|
||||||
"""
|
"""
|
||||||
|
@ -88,4 +91,11 @@ class UsdaNdbDataSource(Enum):
|
||||||
"USDA food data sources"
|
"USDA food data sources"
|
||||||
|
|
||||||
StandardReference = 'Standard Reference'
|
StandardReference = 'Standard Reference'
|
||||||
|
"""
|
||||||
|
Nutritional information for generic food items.
|
||||||
|
"""
|
||||||
|
|
||||||
BrandedFoodProducts = 'Branded Food Products'
|
BrandedFoodProducts = 'Branded Food Products'
|
||||||
|
"""
|
||||||
|
Nutritional information provided to the USDA by the food industry.
|
||||||
|
"""
|
||||||
|
|
Reference in New Issue