Skip to content

Python SDK — overview & install

Python SDK

aiotic-sdk is the reference implementation of everything in this guide. Use it as a library, as a ready-made service, or as a source of patterns for another language.

Rendering diagram…

Modules and how they connect.

Install

bash
pip install "aiotic-sdk[all]"          # client + FastAPI service + CLI
pip install aiotic-sdk                 # client and pipeline only (httpx, pydantic)

Python ≥ 3.11. Extras: server (FastAPI, uvicorn), cli (typer, rich).

Modules

ModuleWhat it gives youGuide page
aiotic.AioticClient / AsyncAioticClientEvery public endpoint as a typed method; retries with backoff; token-bucket rate limit; automatic sync-key routing; orders.wait()Client reference
aiotic.modelsPydantic v2 models pinned to the public OpenAPI (PurchaseOrder, OrderStatus, ErpReceiveRequest, …)Purchase-order model
aiotic.receiveErpReceiver (framework-free) + create_receive_router (FastAPI): key check, idempotency, pipeline, correct responseERP receive endpoint
aiotic.pipelineSanitizers → validators → business rules with built-insPipeline
aiotic.erpErpPort, CatalogPort, CustomerPort; templates FunctionalApiAdapter, DataApiAdapter; InMemoryErpERP adapters
aiotic.syncSyncEngine, ChangeEvent, HashStateStore, PollingChangeSource, reconcile()Sync engine
aiotic.watchOrderWatcher — status transitions from pollingOrder watcher
aiotic.webhooksProcessing-webhook receiver, ERP change-event endpoint, HMAC verifierWebhooks & receivers
aiotic.servicebuild_app() — one call, complete serviceBootstrapping
aiotic.cliaiotic init · doctor · orders · sync · serve · mockCLI
aiotic.mockA mock AIOTIC tenant (aiotic mock)Mock server

Configuration

Settings.from_env() reads AIOTIC_* environment variables (and a .env file in the working directory):

VariablePurpose
AIOTIC_BASE_URLhttps://acme.aiotic.ai
AIOTIC_API_KEYintegration key
AIOTIC_SYNC_API_KEYoptional sync key (used automatically for master-data calls)
AIOTIC_ERP_RECEIVE_KEYkey AIOTIC sends to your receive endpoint
AIOTIC_WEBHOOK_KEYkey AIOTIC sends to your processing webhook
AIOTIC_TIMEOUT, AIOTIC_MAX_RETRIES, AIOTIC_RATE_LIMIT30 s · 3 · 10 req/s

Design principles

  • The API is the truth. Models carry the exact field names and nullability of the OpenAPI document; unknown fields are preserved, so a newer tenant never breaks an older SDK.
  • The integration layer validates. Because some ERPs cannot. Every check is a small class you can add, remove or reorder.
  • Never a full re-upload. The sync engine sends a record only when its fingerprint changed.
  • Framework-free core. ErpReceiver.handle(), Pipeline.run(), SyncEngine.apply() are plain Python. FastAPI routers are thin wrappers; use Flask, Django or a queue consumer if you prefer.
  • Tested against the mock. The SDK's own test-suite runs the mock tenant in-process; your tests can too.

Versioning

The SDK's aiotic.API_VERSION names the API version it was verified against; the guide's changelog lists breaking changes (there have been none: the API evolves additively).

Documentation revision 3 · Published 8 September 2026 · commit 6862d5e. Verified against AIOTIC API v1.0.0. AIOTIC is a product of DevOps Company.