Installation¶
The WiseFood client is a small, dependency-light Python package distributed on PyPI.
Requirements¶
Install from PyPI¶
pip install wisefood
This gives you both clients:
from wisefood import DataClient, Client, Credentials
DataClienttalks to the WiseFood Data API (articles, artifacts, guides, guidelines, textbooks, textbook passages, FCTables).Clienttalks to the WiseFood API (households, members, profiles).
Optional: nicer interactive experience¶
If you work in IPython or Jupyter, install it to get tab-completion of entity slugs inside collection proxies (see Collections):
pip install ipython
client.articles["med<TAB>" # completes to known article slugs
Development install¶
To work on the client or build the documentation locally, install the package in
editable mode together with the docs extra:
git clone https://github.com/wisefood/wisefood-client
cd wisefood-client
python -m venv .venv && source .venv/bin/activate
pip install -e ".[docs]"
Run the test suite with:
pytest
Build the docs with:
sphinx-build -W -b html docs docs/_build/html
See Contributing for the full workflow.
Note
Every example in this documentation reads credentials and base URLs from environment
variables (WISEFOOD_API_URL, WISEFOOD_USERNAME, WISEFOOD_PASSWORD, and for
machine-to-machine auth WISEFOOD_CLIENT_ID / WISEFOOD_CLIENT_SECRET) and uses
placeholder hosts such as https://data.wisefood.example. Never hard-code real
secrets. See Authentication.