Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 18 May 06:08
· 15 commits to main since this release
536af92

Initial release. Targets Compliance API spec revision Rev K
(2026-05-04).

Added

  • Public clientsComplianceClient (sync) and
    AsyncComplianceClient (async). Identical resource surface on both;
    swap one for the other and add await to 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.
  • PaginationCursorPage[T] (used by the Activity Feed, Chats,
    Messages) and OffsetPage[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 by max_download_bytes (default
      100 MiB). Raises FileTooLargeError when 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 under APIError map every documented status code to
    a typed subclass: BadRequestError, InvalidAPIKeyError /
    InsufficientScopeError (a best-effort split of 401),
    PermissionDeniedError, NotFoundError, ConflictError,
    RateLimitError (carrying retry_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 with Retry-After honoured, plus a client-side
    sliding-window rate limiter sized to the server's 600 RPM cap.
    Both tunable / disable-able via max_retries and
    rate_limit_rpm.
  • Typed responses — every response is a plain dataclass.
    Activity-type-specific fields and any future-spec additions are
    preserved in an extra: dict so the SDK does not break when the
    spec grows.
  • Runnable examplesexamples/activity_audit.py,
    examples/ediscovery_export.py, and examples/file_pull.py
    demonstrate the spec's headline compliance use cases end-to-end.
  • Documentation site at
    papermtn.github.io/claude-compliance-sdk.