SDKs
Python SDK
yet-sdk: one client for every product of your company, with nothing to install beyond Python itself.Install
bash
pip install yet-sdkPython 3.10 or later.
A client
A client holds one API key, and finds your company’s addresses from it:
main.py
import yet
client = yet.Client() # the key from YET_API_KEY
for env in client.cloud.environments.list():
print(env["name"], env["domain"])Every argument falls back on the environment:
| Argument | Variable | Default |
|---|---|---|
api_key | YET_API_KEY | — |
base_domain | YET_BASE_DOMAIN | yet.com.br |
cloud_url | YET_CLOUD_URL | https://cloud.<base> |
workspace_url | YET_WORKSPACE_URL | https://<company>.<base> |
Product by product
client.settings: workspace, people, apps. client.iam: access, keys, activity. client.cloud: racks, servers, runtimes, pools, environments, namespaces, applications, databases, dns.
Arguments and answers are snake_case, as the API is: what Yet answers comes as it says it — dicts, as the API reference shows them. A change sends only what it is given: the rest stays.
Settings
python
everyone = client.settings.people.list() # {"people": [...], "members": [...]}
email = client.settings.people.add(
via="password",
full_name="Ana Costa",
password=password,
mailbox="ana",
domains=["acme.dev"],
)
client.settings.apps.set_off(["sketch"])Cloud
python
server = client.cloud.servers.create("box")
print(client.cloud.servers.join(server["id"])["command"]) # run it on the machine
env = client.cloud.environments.create("staging", runtime_id=runtime["id"], color="amber")
db = client.cloud.databases.create("postgres", "orders", environment_id=env["id"])
client.cloud.applications.update(app["id"], replicas=3)
client.cloud.applications.release(app["id"], "ghcr.io/acme/api:1.4.0")Errors
A refusal raises yet.YetError, with Yet’s own words in message and the status in status. yet.NotFoundError and yet.ConflictError are its usual kinds:
python
try:
client.cloud.namespaces.create("shop")
except yet.ConflictError as err:
print(err.message) # There is a namespace with that name already.The SDK is versioned on its own, in SemVer. While below 1.0, a minor version may change what it exposes; its CHANGELOG says how.