Skip to content

Python

sdk/python is generated straight from the API’s own OpenAPI schema — nothing under atlas_client/ is ever hand-edited, so it can never drift from the actual API surface the way a hand-maintained client would each time a route changes shape. Its only runtime dependencies are httpx and attrs.

Terminal window
uv add /path/to/atlas/sdk/python # from another uv project
# or, for pip/poetry/anything else:
cd sdk/python && uv build --wheel && pip install dist/atlas_client-*.whl
from atlas_client import AuthenticatedClient
from atlas_client.api.workspaces import workspaces_list_all
client = AuthenticatedClient(base_url="http://localhost:8000", token="atlas_...")
workspaces = workspaces_list_all.sync(client=client)
for workspace in workspaces:
print(workspace.bucket, workspace.id)

Every operation module exposes four variants: sync (the value, or None on a non-2xx), sync_detailed (the full response, status code included), and their asyncio/asyncio_detailed equivalents under async with client:.

Terminal window
cd sdk/python
./regenerate.sh # defaults to http://localhost:8000; set API_URL to override

This fetches the spec fresh from a running API and rewrites everything under atlas_client/. Review the diff like any other generated-code change — mostly noise, but a route that changed shape is worth reading. README.md and pyproject.toml’s metadata are hand-maintained and survive a regen.

Enums (WorkspaceRoleName, DocumentState, …) come out as Literal[...] type aliases rather than enum.Enum classes — lighter, and it sidesteps a real generator failure mode where two enum members differing only by case or punctuation collide once sanitized into Python identifiers.