SDK Reference
Python SDK
vendo-sdk v1.0.0 — install, public surface, and reference links.
Package
| Package | vendo-sdk |
| Version | 1.0.0 |
| PyPI | pypi.org/project/vendo-sdk |
| Source | github.com/runvendo/vendo-sdk-py |
| Changelog | CHANGELOG.md |
| Requires | Python 3.9+ |
Install
pip install vendo-sdk
# With HTTP session helper (requests):
pip install "vendo-sdk[http]"
# With async support (aiohttp):
pip install "vendo-sdk[async]"Public surface
Module-level shortcuts
import vendo
vendo.token(slug) # str — fetch single token
vendo.tokens(slugs) # dict[str, str | None]
vendo.session(slug) # requests.Session (requires [http])
vendo.connect_url(slug, return_to=None) # str (Vendo mode only)
vendo.is_vendo_mode() # boolClass-based client
from vendo import Vendo, AsyncVendo
client = Vendo(api_key=None, base_url=None)
client.token(slug)
client.tokens(slugs)
client.session(slug)
client.connect_url(slug, return_to=None)
client.invalidate(slug)
# Scoping
client.for_request(headers) # → Vendo (Vendo mode only)
client.for_user(jwt) # → Vendo (Vendo mode only)
# Sub-APIs
client.connections # ConnectionsAPI
client.integrations # IntegrationsAPI
client.billing # BillingAPI (Vendo mode only)
client.events # EventsAPI (Vendo mode only)
client.webhooks # WebhooksAPI (works in both modes)
client.sso # SSOAPI
client.deployment # DeploymentAPI
client.reconciler # ReconcilerAPIAsync client
from vendo import AsyncVendo, aio
async with AsyncVendo() as client:
tok = await client.token(slug)
conns = await client.connections.list()
# Module-level async shortcuts:
await aio.token(slug)
await aio.tokens(slugs)
await aio.connections.list()
await aio.integrations.list()
await aio.billing.balance()ConnectionsAPI
client.connections.list() # list[Connection]
client.connections.get(slug) # Connection | NoneIntegrationsAPI
client.integrations.list() # list[Integration]
client.integrations.get(slug) # Integration | None
client.integrations.env_vars(slug) # list[str]BillingAPI (Vendo mode only)
client.billing.balance() # BalanceEventsAPI (Vendo mode only)
async with client.events.subscribe() as stream:
async for event in stream:
print(event.kind, event.data)WebhooksAPI
client.webhooks.verify(headers, body, max_age_seconds=300) # WebhookEventReconcilerAPI
vendo.reconciler.bootstrap(env_file, mapping)
vendo.reconciler.start(env_file, mapping, on_change=None) # ReconcilerErrors
from vendo.errors import (
VendoError,
NotConnected,
NeedsReauth,
AuthError,
RateLimited,
BalanceExhausted,
SpendCapExceeded,
UpstreamError,
ValidationError,
IdempotencyConflict,
VendoOnlyFeature,
IdentityNotPresent,
)See Concepts: Errors for usage.
Testing utilities
from vendo.testing import MockClient, MockAsyncClient, fake_connectionThe async aio.* shortcuts and the sync vendo.token() share the same in-process token cache. You can call either path interchangeably without double-fetching.