v0.1.0
Initial release. Targets Compliance API spec revision Rev K
(2026-05-04).
Added
- Public clients —
ComplianceClient(sync) and
AsyncComplianceClient(async). Identical resource surface on both;
swap one for the other and addawaitto switch styles. - Resource groups covering every Rev K endpoint:
activities— cursor-paginated Activity Feed list / iter.organizations— unpaginated org list, plus paginated users
per org.projects— list, get (detail), delete, and attachment listing.project_documents— fetch document text content and delete.chats— cursor list of chats, combined chat-with-messages
fetch, message iteration, and delete.files— user-uploaded file metadata, download, delete.generated_files— assistant tool-use outputs (download only;
not deletable per spec).artifacts— versioned text artifacts (download only).roles— org-scoped role list, fetch, and permissions list.groups— group list, fetch, and member list.
- Pagination —
CursorPage[T](used by the Activity Feed, Chats,
Messages) andOffsetPage[T](everything else). Every paginated
resource exposes both.list()(one page) and.iter()
(auto-paginate) methods. - Downloads — three resource groups (
files,generated_files,
artifacts) share the same trio:.download(id)— eager, bounded bymax_download_bytes(default
100 MiB). RaisesFileTooLargeErrorwhen the cap is exceeded..download_to_file(id, path)— streamed to disk, unbounded..download_stream(id)— yields chunks for caller-managed
streaming.
- Typed exception hierarchy rooted at
ComplianceClientError.
HTTP failures underAPIErrormap every documented status code to
a typed subclass:BadRequestError,InvalidAPIKeyError/
InsufficientScopeError(a best-effort split of 401),
PermissionDeniedError,NotFoundError,ConflictError,
RateLimitError(carryingretry_after),APIStatusError,
InternalServerError. Transport-level failures live under
APIConnectionError/APITimeoutError. Every error carries
status_code,request_id,error_type,error_message, and
the raw response body. - Resilience — exponential-backoff retry on 429 / 5xx / connect
errors withRetry-Afterhonoured, plus a client-side
sliding-window rate limiter sized to the server's 600 RPM cap.
Both tunable / disable-able viamax_retriesand
rate_limit_rpm. - Typed responses — every response is a plain dataclass.
Activity-type-specific fields and any future-spec additions are
preserved in anextra: dictso the SDK does not break when the
spec grows. - Runnable examples —
examples/activity_audit.py,
examples/ediscovery_export.py, andexamples/file_pull.py
demonstrate the spec's headline compliance use cases end-to-end. - Documentation site at
papermtn.github.io/claude-compliance-sdk.