wisefood-client
A small, robust Python client for accessing and populating the data infrastructure of the WiseFood platform.
The WiseFood platform exposes two distinct APIs, and this package ships one client for each:
DataClient— the WiseFood Data API: articles, artifacts, guides, guidelines, textbooks, textbook passages, and food-composition tables (FCTables).Client— the WiseFood API: households, members, and member profiles.
Install
pip install wisefood
Quickstart
import os
from wisefood import DataClient, Credentials
client = DataClient(
os.environ["WISEFOOD_API_URL"],
Credentials(username=os.environ["WISEFOOD_USERNAME"],
password=os.environ["WISEFOOD_PASSWORD"]),
)
article = client.articles["some-article-slug"]
print(article.title)
for hit in client.articles.search("mediterranean diet", limit=5):
print(hit.title)
Machine-to-machine auth uses client_id / client_secret instead of username/password.
Usage telemetry
The client reports which SDK operations you call, whether they succeeded and how long they took, so platform usage reports account for scripts and notebooks and not only the web app. It never sends your arguments, your results, or anything you passed in.
client.analytics.track("feature.used", app="catalog", feature="bulk-import")
client.feedback.submit(target_type="article", target_id=urn, rating="up",
comment="the extraction looks right")
print(client.analytics.session_id) # groups everything this client did
Turn it off with the environment variable or the constructor:
export WISEFOOD_TELEMETRY=0
client = Client(url, credentials, telemetry=False)
It is queued and sent on a background thread, so it never blocks or raises into
your code, and it switches itself off against a deployment whose gateway does
not accept it. client.analytics.flush() sends what is queued and keeps going;
close() stops it, and runs automatically at exit.
Documentation
Full docs (concepts, per-resource guides, API reference) live at https://wisefood-client.readthedocs.io.
License
See LICENSE.
Release files for wisefood 0.0.33
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wisefood-0.0.33.tar.gz | 110.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wisefood-0.0.33-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 205.6 kB
Release files / wisefood-0.0.33.tar.gz
| Download URL | wisefood-0.0.33.tar.gz |
|---|---|
| Size | 110.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe00676b66b600607ec13e656e3700e504e85bfbaf733fea63ff5a087ad935f7
|
|
BLAKE2b-256 checksum How to use checksums |
bff6535243a8cfd06e0a8da9baf14f2724b892edda6ef0aaacab5aad824cc7f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / wisefood-0.0.33-py3-none-any.whl
| Download URL | wisefood-0.0.33-py3-none-any.whl |
|---|---|
| Size | 95.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8da31a09cfb21b8f152182e7209a277ebbe58298cdb49d38d1a60091586204c
|
|
BLAKE2b-256 checksum How to use checksums |
d0781e5f33286fa90ab30c7739f97bb2964f52a74be85928d2b2cca548d8970b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|