yama-python¶
The official Python client for the Yama access-control API. Manage a building's access codes and read its call log from Python. The client handles auth, pagination, retries and errors, and gives you typed objects back.
This site covers the Python client. The REST API itself is documented at https://app.yamasystems.com/api/v2/docs/, and the client's resources, fields and filters use the same names.
Install¶
uv add yama-client # or: pip install yama-client
It needs Python 3.10 or newer, and depends only on httpx and Pydantic.
Quick start¶
Create an API key in the Yama portal under Settings › API keys, with read access to access codes and the call log, and set it as YAMA_API_KEY. Keep it out of source control.
from datetime import datetime, timezone
from yama import Yama
client = Yama() # reads YAMA_API_KEY
for code in client.codes.list():
print(code.name, code.expires_at)
start = datetime(2026, 10, 1, tzinfo=timezone.utc)
end = datetime(2026, 11, 1, tzinfo=timezone.utc) # exclusive: all of October
for call in client.calls.list(start=start, end=end):
print(call.started_at, call.result)
Next steps¶
- Configuration: API keys, timeouts, retries and your own
httpx.Client. - Reading and writing: lists, filters, the call log, and changing access codes.
- Errors and retries: what to catch, and how creates stay safe to repeat.
- Logging, Testing, Web apps and background jobs and Versioning.
- Reference: every class and method.