Python SDK
The official thrustlab package on
PyPI — a synchronous Python wrapper
around the /v1/ HTTP API. Bearer auth, automatic
idempotency keys on mutations, retries with backoff, cursor pagination,
blocking waits for async resources, and webhook signature verification, all
out of the box.
Install
pip install thrustlab
Requires Python 3.10+. Verify the install:
python -c "import thrustlab; print(thrustlab.__version__)"
First call
Set $THRUSTLAB_API_KEY to a key from
/dashboard/api-keys, then:
from thrustlab import Client
client = Client()
me = client.users.me()
print(me["email"], me["tier"])
For the full constructor (custom base URL, timeouts, retries, custom httpx client), see configuration.
Resources
Every public /v1/ route family is available as an attribute on
Client. Resources lazy-initialize on first access, so importing Client
is cheap.
| Accessor | Description |
|---|---|
client.users | Read the calling user's profile |
client.projects | Workspaces for sims, sweeps, and starred components |
client.simulations | Single-point steady-state simulations (async) |
client.sweeps | Multi-point parameter studies (async) |
client.dynamic_simulations | Time-domain missions: schedule → samples / series / scorecard (async) |
client.components | Catalog of motors / propellers / batteries / ESCs |
client.submissions | Submit a custom component for moderation |
client.starred_components | Per-project favorites |
client.compute_units | Balance and transaction history |
client.webhook_endpoints | Register and manage webhook endpoints |
Patterns
Cross-cutting concerns covered once instead of per-resource:
| Topic | Description |
|---|---|
| Configuration | Constructor args, env vars, custom httpx client |
| Idempotency | Auto-generated and explicit Idempotency-Keys |
| Pagination | CursorPager, auto-iterate, manual cursor |
| Async resources | wait() polling vs webhooks |
| Retries & timeouts | Automatic retry policy and tuning |
| Error handling | Typed exceptions, code catalog, request_id |
| Webhook verification | Webhook.verify for incoming deliveries |
| Logging & debugging | Logger names, retry traces, httpx logs |
| Versioning & stability | SemVer policy, deprecation timeline |
Source + issues
Source lives in the public
thrustlab-sdk repository. File
issues there or email [email protected]
with your request_id.