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.
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-*.whlfrom atlas_client import AuthenticatedClientfrom 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:.
Regenerating after a backend change
Section titled “Regenerating after a backend change”cd sdk/python./regenerate.sh # defaults to http://localhost:8000; set API_URL to overrideThis 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.