Skip to main content

whodb-sdk

Official Python SDK for the WhoDB hosted platform — your ontology, datasets, sources, transforms, functions, and org administration as in-code function APIs.

Install

pip install whodb-sdk

Requires Python ≥ 3.10.

Quickstart

import os
from whodb import WhoDB

# Production: API key (create one in org settings → API keys).
whodb = WhoDB(api_key=os.environ["WHODB_API_KEY"])

# Local development: zero config — reuses your `whodb login` session.
# whodb = WhoDB()

users = whodb.ontology("User")

user = users.get("u_123")
active = users.list(where={"status": {"eq": "active"}}, page_size=100).all()
users.create({"email": "a@b.co"})
users.create_many(rows, idempotency_key="import-42")
users.update("u_123", {"plan": "pro"})
orders = users.follow_link("u_123", "orders").all()

# Behavior-managed workflow:
order = whodb.ontology("Order")
capabilities = order.capabilities("order_123")
order.preview_action("approve", "order_123", {"note": "Looks good"})
order.action(
    "approve", "order_123", {"note": "Looks good"},
    expected_version=capabilities.get("recordVersion"),
    idempotency_key="approve-order-123",
)
history = order.action_executions("order_123")

# Iterate everything, page by page:
for page in users.list(page_size=500).pages():
    print(len(page.rows))

# Datasets, transforms, functions:
kpis = whodb.dataset("weekly_kpis").rows()
rollup = whodb.transform("nightly-rollup")
run = rollup.run()
rollup.wait(run["id"], timeout_ms=300_000)
fn = whodb.function("normalize")
fn.promote("v1")  # snapshot + set active production version
result = fn.execute({"name": "Ada"})
versions = whodb.versions().list("function", fn.meta()["id"])

# Org administration (requires org manage rights):
sa = whodb.service_accounts().create("ci-deployer")
raw_key = whodb.service_accounts().create_key(sa["id"])["rawKey"]  # shown once — store it securely
whodb.sharing().share("ont_...", "organization")

# Async client:
from whodb import AsyncWhoDB
awhodb = AsyncWhoDB(api_key=os.environ["WHODB_API_KEY"])
user = await awhodb.ontology("User").get("u_123")

Authentication

Credential precedence: constructor args (api_key= / token= / credentials=) → WHODB_API_KEY env var → the whodb CLI's stored login. Workspace (org= / project=) is optional with an API key; pass project= when the key has access to more than one project.

Inside a WhoDB Function, WhoDB() auto-detects the runtime and needs no configuration at all.

Typed clients

whodb sdk generate --language python --out whodb_gen/

License

Apache-2.0

Metadata

Release files for whodb-sdk 0.141.0

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

Source distribution (sdist)

Source distribution for whodb-sdk 0.141.0
File Size Uploaded Provenance Actions
whodb_sdk-0.141.0.tar.gz 44.5 kB With provenance Details for whodb_sdk-0.141.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whodb-sdk 0.141.0
File Interpreter ABI Platform Actions
whodb_sdk-0.141.0-py3-none-any.whl Python 3 none any Details for whodb_sdk-0.141.0-py3-none-any.whl

Total release size: 94.3 kB

Release files / whodb_sdk-0.141.0.tar.gz

Download URL whodb_sdk-0.141.0.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
44d2777f1a100cb1046a3be6adba977d4963f7e4778b2fec0cc7b678fae35c91
BLAKE2b-256 checksum
How to use checksums
f135233a49d7feb85151d3e1dadf21d67655ff29fa55974e262fb7409554d181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / whodb_sdk-0.141.0-py3-none-any.whl

Download URL whodb_sdk-0.141.0-py3-none-any.whl
Size 49.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
933310f8f88a088c61f0422591769a540baaa5670b9b1f86fd085bdc4e650b10
BLAKE2b-256 checksum
How to use checksums
4da0fc673be3cee9069b421c753946e17c96aafdf46ec792f1b93f97ecf70259
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for whodb-sdk 0.141.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for whodb_sdk-0.141.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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