| name | tembo-sdk-python-sdk |
|---|---|
| description | Python SDK for Tembo SDK API. Use when writing Python code that calls Tembo SDK API with the tembo-sdk-python package: installing it, constructing and authenticating the client, and calling API operations. |
Generated Python client for Tembo SDK API, published as tembo-sdk-python. Use the generated client instead of hand-writing HTTP requests.
pip install tembo-sdk-pythonimport os
from tembo import Tembo
client = Tembo(
api_key=os.environ.get("TEMBO_API_KEY"),
)Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them:
api_key(env:TEMBO_API_KEY) — Credential for the apiKey scheme.
import os
from tembo import Tembo
client = Tembo(
api_key=os.environ.get("TEMBO_API_KEY"),
)
api_key = client.api_keys.list(
limit=50,
)
print(api_key)Method names, parameter shapes, and response types are generated from the API description — do not guess them. Look up the exact call signature in api.md before writing a call.
WebSocket endpoints open a persistent connection you can send messages to and receive messages from.
with client.live.connect() as connection:
message = connection.recv()
print(message)Non-success responses throw generated API errors. Error objects expose status, headers, response body, and request metadata where the target runtime supports it.
from tembo import APIStatusError
try:
api_key = client.api_keys.list(
limit=50,
)
except APIStatusError as err:
print(err.status_code, err.message)
raise- Python 3.9 or newer