Repository navigation
0.1.0
First version of the Python SDK for the Doctronic API, built from the public OpenAPI contract
(info.version 0.1.0, 22 operations).
Added
DoctronicandAsyncDoctronicclients, configured fromDOCTRONIC_API_TOKENand
DOCTRONIC_ENVIRONMENT, with staging and production base URLs.for_user(user_id): a user-scoped client that sendsX-Doctronic-User-ID. Only
users.create()andpharmacy.search()are on the base client.- Resources:
users,chats,appointments,address,pharmacy,coverage, andartifacts,
covering every operation in the contract. chats.stream(): typed Server-Sent Events as an iterator (sync) or async iterator, a context
manager withclose(), unknown events passed through asUnknownChatStreamEvent, and
final_messages(). The timeout covers the wait until the stream starts.close()is safe
from another thread or task, and the reader raisesAPIUserAbortError.- Idempotency keys generated per call for the 11 operations whose contract declares
Idempotency-Key, reused on every retry. - Retries with exponential backoff and jitter that honor
Retry-After, following the facts the
contract declares for each operation. The stream is never retried. - Typed errors:
APIErrorand one subclass per documented status,BadRequestError.field_errors
forerror.validation_error, connection and timeout errors, andAPIUserAbortError. 403 error.auth.insufficient_scoperaisesPermissionDeniedError. Itsdatavalidates as
doctronic.types.InsufficientScopeData, whoserequired_scopenames theScopethe API key
lacks.artifacts.wait_until_ready(): polls a consultation document with bounded backoff, under one
deadline that covers every poll, retry, and wait.verify_webhook(): HMAC-SHA256 verification and typed webhook events.with_raw_responseon every client and resource, for the status, headers, and request ID.- Pydantic v2 models generated from the contract, with snake_case attributes and camelCase
aliases.
Published to PyPI as doctronic 0.1.0.