Skip to main content

wisefood-client

PyPI version Python versions Documentation Status License

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.36

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wisefood 0.0.36
File Size Uploaded
wisefood-0.0.36.tar.gz 134.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wisefood 0.0.36
File Interpreter ABI Platform
wisefood-0.0.36-py3-none-any.whl Python 3 none any Details

Total release size: 244.9 kB

Release files / wisefood-0.0.36.tar.gz

Download URL wisefood-0.0.36.tar.gz
Size 134.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a4f172eef442671e82849505a8880e986cec48ef31be5fd9674f8ea09e4e89cf
BLAKE2b-256 checksum
How to use checksums
c1efc6be0f77503dc14f3c13f12259539351a5ba6e215c3ed6acdbbc20cbe3c5
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.36-py3-none-any.whl

Download URL wisefood-0.0.36-py3-none-any.whl
Size 110.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1eaa22386ee368c90711fcc4c36783617776b2471c070b6d3d46ce4d9621d64
BLAKE2b-256 checksum
How to use checksums
8aa1b97e1cc029b40cbc1b6e8f5d69b88b60b1b4bf29ac7ef07ad9d5f9a33041
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.37

2 release files

This release

0.0.36 This release

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.26

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page