Official Python SDK for Imbrace — dual auth (API Key + Access Token)
Project description
Imbrace Python SDK
Official Python client for the Imbrace Gateway. Supports sync and async.
Installation
pip install imbrace
Quick Start
API Key — server-side scripts, Celery tasks
from imbrace import ImbraceClient
client = ImbraceClient(api_key="sk-xxx...")
me = client.platform.get_me()
Access Token — after user login
client = ImbraceClient(access_token="acc_xxxxxxxxxxxxx")
OTP Login Flow
client = ImbraceClient()
client.request_otp("user@example.com")
client.login_with_otp("user@example.com", "123456")
# all subsequent calls are authenticated
me = client.platform.get_me()
Async Client
from imbrace import AsyncImbraceClient
async with AsyncImbraceClient(api_key="sk-xxx...") as client:
me = await client.platform.get_me()
Error Handling
from imbrace import AuthError, ApiError, NetworkError
try:
client.platform.get_me()
except AuthError:
print("Invalid credentials")
except ApiError as e:
print(f"[{e.status_code}] {e}")
except NetworkError:
print("Gateway unreachable")
Environment Variables
| Variable | Description |
|---|---|
IMBRACE_API_KEY |
API key (server-side auth) |
IMBRACE_GATEWAY_URL |
Override gateway URL (default: https://app-gatewayv2.imbrace.co) |
IMBRACE_ENV |
Environment preset: develop, sandbox, stable (default: stable) |
Development
pip install -e ".[dev]"
pytest # unit tests
pytest tests/integration # integration tests (requires IMBRACE_API_KEY)
Resources
Full resource reference: sdk.imbrace.co/python/resources
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 imbrace-1.1.0.tar.gz.
File metadata
- Download URL: imbrace-1.1.0.tar.gz
- Upload date:
- Size: 75.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88becc3caa11b5043df4c55fe19b65b78d39ecbf4db9f263080c17628d08a49d
|
|
| MD5 |
f160147bdfe048dc56a7f7cc60eb984c
|
|
| BLAKE2b-256 |
6efe9166615ef6936e9f048684103a68abdc0c7dca3409d111dccc60ae019a84
|
Provenance
The following attestation bundles were made for imbrace-1.1.0.tar.gz:
Publisher:
publish-py-pypi.yml on imbraceltd/api-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbrace-1.1.0.tar.gz -
Subject digest:
88becc3caa11b5043df4c55fe19b65b78d39ecbf4db9f263080c17628d08a49d - Sigstore transparency entry: 1624570963
- Sigstore integration time:
-
Permalink:
imbraceltd/api-sdk@024b242799cd73cee3b2d4b5704945acc785e085 -
Branch / Tag:
refs/tags/py-v1.1.0rc0 - Owner: https://github.com/imbraceltd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-py-pypi.yml@024b242799cd73cee3b2d4b5704945acc785e085 -
Trigger Event:
push
-
Statement type:
File details
Details for the file imbrace-1.1.0-py3-none-any.whl.
File metadata
- Download URL: imbrace-1.1.0-py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11bb135a9291041b597a90c3bdf5b4cc89bc18d4079e5b70511f1f1061328733
|
|
| MD5 |
3fb15268f805eb1c243e6610b30738c4
|
|
| BLAKE2b-256 |
c93d81c78937c7de2b8bb64f4eaa2e886d7d3f1536424a2051c61067c21cc75c
|
Provenance
The following attestation bundles were made for imbrace-1.1.0-py3-none-any.whl:
Publisher:
publish-py-pypi.yml on imbraceltd/api-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbrace-1.1.0-py3-none-any.whl -
Subject digest:
11bb135a9291041b597a90c3bdf5b4cc89bc18d4079e5b70511f1f1061328733 - Sigstore transparency entry: 1624570979
- Sigstore integration time:
-
Permalink:
imbraceltd/api-sdk@024b242799cd73cee3b2d4b5704945acc785e085 -
Branch / Tag:
refs/tags/py-v1.1.0rc0 - Owner: https://github.com/imbraceltd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-py-pypi.yml@024b242799cd73cee3b2d4b5704945acc785e085 -
Trigger Event:
push
-
Statement type: