A client library for accessing Busbar Admin API
Project description
busbar-admin (Python SDK)
A typed Python client for the Busbar Admin API (/api/v1/admin).
The client is generated from the typed OpenAPI 3.1 schema in
openapi.json with
openapi-python-client,
so every response is a real dataclass (InfoView, TopologyInfo, ...) — not
Any/dict.
PyPI package name:
busbar-admin. (busbaris already taken on PyPI, so the admin SDK ships asbusbar-admin.)
Versioning
The SDK carries its own semantic version, independent of the busbar server /
OpenAPI info.version (currently 1.4.0). This first cut is 0.1.0. A given
SDK release targets the frozen, additive-only /api/v1/admin surface and will
keep working across server versions on that surface.
Install
pip install busbar-admin
Usage
The admin API authenticates with an x-admin-token header. Construct an
AuthenticatedClient that sends the token under that header name (no Bearer
prefix):
from busbar_admin import AuthenticatedClient
from busbar_admin.api.default import get_api_v1_admin_info
from busbar_admin.models import InfoView
client = AuthenticatedClient(
base_url="http://localhost:8081",
token="YOUR_ADMIN_TOKEN",
# send the credential as `x-admin-token: <token>` instead of Authorization: Bearer
auth_header_name="x-admin-token",
prefix="",
)
with client as client:
info: InfoView = get_api_v1_admin_info.sync(client=client)
# `info` is TYPED — your editor autocompletes .version, .topology, .build, ...
print("busbar version:", info.version) # -> "1.4.0"
print("pools:", info.topology.pools)
print("config version:", info.config_version)
Prefer
Authorization: Bearer? Drop theauth_header_name/prefixoverrides — the defaultAuthenticatedClientsendsAuthorization: Bearer <token>, which the admin API also accepts.
Async is available too (get_api_v1_admin_info.asyncio / .asyncio_detailed).
Regenerating the client
The committed client is generated from openapi.json. To re-derive it:
make generate # pins openapi-python-client via requirements-dev.txt
CI regenerates on every PR/push and fails if the committed client drifts from
openapi.json (git diff --exit-code).
License
Apache-2.0 © Busbar, Inc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file busbar_admin-0.1.0.tar.gz.
File metadata
- Download URL: busbar_admin-0.1.0.tar.gz
- Upload date:
- Size: 45.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c53b9a25a642b10a5802247c4a4ca8dcc09c81362b850d0bb1f8a3b0156e288
|
|
| MD5 |
d9c49323d1090f802d35fee2a29962cf
|
|
| BLAKE2b-256 |
da5ce93cdbaedc81bba78767f2a1f6b7d58eea7bb9e00f1134692098ef02beb8
|
File details
Details for the file busbar_admin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: busbar_admin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 118.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1546bc6980bb48b05901c102372e2de8a8275625047f81d595127e05f83f776e
|
|
| MD5 |
3e2dad88c5be3bf86f6d8c2032720863
|
|
| BLAKE2b-256 |
4ec45a989bc2ce63949247fd1f37ef6fc0a4af5edf4a1e54c45287c3452841d5
|