Metadata-Version: 2.5
Name: aice-core
Version: 0.3.0
Summary: Shared HTTP transport, retry, error and auth primitives for the AICE Python SDKs
Author-email: Adanian Labs <engineering@adanianlabs.io>
License: MIT
Keywords: aice,http,sdk,transport
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# aice-core

Shared primitives for every AICE Python SDK: HTTP transport, retry/backoff,
typed errors, and auth context. Each service SDK (`aice-reco-sdk`,
`aice-knowledge`, `aice-crawler`, …) depends on this package; nothing in here
is service-specific.

## What lives here

- **`AuthContext`** holds the API key, decodes service scopes, raises
  `InsufficientScopeError` client-side before any request goes out.
- **`SyncTransport` / `AsyncTransport`** the single `_request()` entry point
  every service client routes through. Injects auth, handles retries,
  maps HTTP errors to typed exceptions, sets `User-Agent`.
- **Error hierarchy** (`aice_core.exceptions`) one shared set of errors.
- **`Page[T]`** generic paginated iterator (`SyncPage` / `AsyncPage`).

## What doesn't live here

Service-specific endpoints, request/response models, or resource classes.
Those are in their own packages under `python/<service>/`.

## Why this exists

Six different implementations of "retry on 5xx with exponential backoff, map
401 to AuthError" is five too many. Fixing retry once, here, fixes retry
everywhere.
