Skip to main content

Python SDK for the oblet control plane.

Project description

oblet — Python SDK

The Python client SDK for the oblet control plane. It is a hand-written native surface over Buf-generated Connect plumbing, mirroring the Go reference SDK at pkg/client: one client per service, native parameter and result types, typed errors carrying the wire reason, point-in-time reads, and offline capability-token attenuation. Both a synchronous Client and an asyncio AsyncClient are provided over the same native types.

The package is self-contained — its own dependency closure, its own generated stubs committed under src/oblet/ — and extracts to a standalone repository by moving this directory.

Install

pip install oblet

Synchronous

import oblet

client = oblet.Client("https://control.example.com", token="<capability token>")

obj = client.object.head(oblet.object.HeadParams(workspace="ws", branch="main", key="doc.txt"))
print(obj.key, obj.size)

# Point-in-time read pinned to an audit leaf.
old = client.object.head(
    oblet.object.HeadParams(workspace="ws", branch="main", key="doc.txt"),
    oblet.CallOptions(at_leaf=42),
)

Asyncio

import oblet

client = await oblet.AsyncClient.connect("https://control.example.com", token="<capability token>")
obj = await client.object.head(oblet.object.HeadParams(workspace="ws", branch="main", key="doc.txt"))

AsyncClient is built through the await AsyncClient.connect(...) factory so the one-shot health ping can run; everything else mirrors Client.

Typed errors

try:
    client.object.head(oblet.object.HeadParams(workspace="ws", branch="main", key="missing"))
except oblet.PermissionDenied as err:
    print(err.reason)          # "pdp_denied"
except oblet.Error as err:     # base of every wire error
    print(oblet.reason_of(err))

Offline token attenuation

narrower = oblet.attenuate_token(token, ['resource == "doc1"'], ttl_seconds=3600, public_key=issuer_hex)

Layout

  • src/oblet/ — the public package; __init__.py re-exports only.
  • src/oblet/<service>/ — the native surface; the generated wire layer is the v1alpha1/ subpackage beneath it.
  • tests/ — per-service tests against a real in-process Connect server, plus the conformance gates.

Development

make sdk-python-gen   # regenerate the wire layer from api/proto
make sdk-python       # ruff, pyright, pytest

See oblet-dev/design-docs/adr/0076-public-python-sdk.md for the design.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oblet-0.0.0.tar.gz (258.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oblet-0.0.0-py3-none-any.whl (233.6 kB view details)

Uploaded Python 3

File details

Details for the file oblet-0.0.0.tar.gz.

File metadata

  • Download URL: oblet-0.0.0.tar.gz
  • Upload date:
  • Size: 258.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for oblet-0.0.0.tar.gz
Algorithm Hash digest
SHA256 be10f0730e0f1c94aa8f6e9e9919d40a879c609af235ee921cb575bfccee2e1f
MD5 4decc3773c3b21174ba4fb23dbb249d7
BLAKE2b-256 f27ba3d7d476fbbfa94d5df753b0556734e1668c36a177c754df85b61b1ed7f9

See more details on using hashes here.

File details

Details for the file oblet-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: oblet-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 233.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for oblet-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64e1d3a4da2e76c07f2a6693f8b55c1ac5717503aa959c4758adb66215c59168
MD5 0819221eeba32d273e698396cd6ed346
BLAKE2b-256 0f4dac959b170aefe80a8c8127a28a5b66245090db01e831fbf5c54a9464890f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page