Repository navigation
Releases: doctronic-ai/doctronic-sdk-python
Releases · doctronic-ai/doctronic-sdk-python
Release list
0.1.1
Built from the same contract as 0.1.0 (info.version 0.1.0, 22 operations).
Changed
- Responses from a newer API no longer fail. The docs promise that clients can ignore values
they don't know, and 0.1.0 raisedAPIResponseValidationErrorinstead:- Enums accept values this version doesn't list. A new appointment status comes back as an
AppointmentStatusthat equals the string, such as"on_hold", with thatvalue; the known
values are the same members as before. Compare with the members you handle and treat
anything else as unknown. This applies to every enum indoctronic.types, including
Scope,Role,Sex, andState. - Data that doesn't match the contract, such as a missing field or a value of another type, is
returned instead of raised. Fields that match are typed as usual, and the others are kept as
the API sent them. Missing required fields areNone; optional fields keep their defaults.
The SDK logs a warning on thedoctroniclogger that names the request ID and the fields,
never their values. APIResponseValidationErrornow means the SDK can't use the response at all: the body isn't
JSON,datais missing ornullfor an operation that returns data, or a200stream isn't
text/event-stream.
- Enums accept values this version doesn't list. A new appointment status comes back as an
verify_webhook()raisesWebhookVerificationErrorfor an empty secret instead of
ValueError, as the TypeScript SDK does. A handler that answersWebhookVerificationError
with400now also rejects deliveries when its secret isn't configured. Code that caught
ValueErrorfor this case should catchWebhookVerificationError.- Retries of
409read the contract'sx-doctronic-retryable-codesextension. A code the
contract documents for the operation is final unless that list names it, such as
error.idempotency.concurrent_request;error.idempotency.payload_mismatchis final. Without
the extension, the rules are the same as in 0.1.0. scripts/generate.pyreadsopenapi/doctronic-v1.json, a pinned copy of the public contract,
by default, and the required codegen check compares against it. It covers only operations that
take the organization API token (HTTPBearer), so browser-only operations such as/embed/*
and the schemas only they use stay out of the SDK. For today's contract the generated
operations are unchanged.
Added
WEBHOOK_SIGNATURE_HEADER, the TypeScript SDK's name for the signature header.
SIGNATURE_HEADERstays.async with patient.chats.stream(...) as stream:onAsyncDoctronic, without the extra
await.stream()returns anAsyncChatStreamManager. Awaiting it still returns the
AsyncChatStream,async with await ...still works, and it's still a coroutine for
asyncio.create_task()andasyncio.gather().- Python 3.14 and 3.15 in the classifiers and the CI test matrix.
- Package metadata: keywords, and classifiers for the development status, audience, operating
system, topics, AsyncIO, and Pydantic 2. regenerate.yml: when the docs publish a contract, and daily, it updates the pinned contract,
regenerates, runs the checks, and opens a pull request that lists new operations and is
labeledbreaking-changewhen the docs flag one.contract-drift.yml: a daily job that reports when the pinned contract falls behind the
published one. It isn't a required check.- README sections on versioning and support, and a link to the TypeScript SDK.
CONTRIBUTING.md, a code of conduct (Contributor Covenant 2.1), issue and pull request
templates that warn against posting tokens or patient data, andCODEOWNERS.- Each release gets a GitHub Release with its CHANGELOG entry as the notes. The release workflow
stops before publishing when the CHANGELOG has no entry for the version.
Fixed
- The README's links to
examples/quickstart.pyandLICENSEwere relative and broke on PyPI;
every link in the README is absolute now. Its webhook example imports what it uses. examples/quickstart.pyno longer readsDOCTRONIC_API_URL, which the SDK never reads. Pass
base_url=to point the client somewhere else.- Building from the sdist accepts any hatchling from 1.27 (the first with PEP 639 license
metadata) up to 2, instead of exactly 1.32.4. - The sdist no longer includes the repository's
.gitignore. PermissionDeniedErrordescribed a403for a user the organization can't act on. The
contract documents403only forerror.auth.insufficient_scope; that user case is a404.
Security
- certifi before 2026.10.18 bundles emSign root CAs whose intermediate keys were compromised
(GHSA-6q48-6c7w-9gw2). httpx uses certifi for TLS verification. The SDK doesn't pin certifi,
so upgrade it in your environment:pip install --upgrade "certifi>=2026.10.18". The
repository's lockfile now has 2026.10.23.
Published to PyPI as doctronic 0.1.1.
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.