Metadata-Version: 2.5
Name: datanivra-sdk
Version: 0.1.0
Summary: Typed Python SDK for the DataNivra control-plane API.
Project-URL: Homepage, https://www.datanivra.com
Project-URL: Documentation, https://www.datanivra.com/docs/sdk
Project-URL: Examples, https://github.com/DataNivra/datanivra-examples
License: Proprietary
License-File: LICENSE
Keywords: api-client,datanivra,test-data-management
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.12
Requires-Dist: datanivra-contracts<2,>=1.0.0
Requires-Dist: httpx>=0.27
Requires-Dist: pyyaml<7,>=6.0.2
Description-Content-Type: text/markdown

# datanivra-sdk

Typed Python SDK for the DataNivra control-plane API v1 (boundary owner: DX-02).

```python
from datanivra_sdk import DataNivraClient

with DataNivraClient("https://api.example.test", token=session_token) as api:
    for job in api.paginate(api.list_jobs, state="FAILED"):
        print(job.id, job.state)
```

* `src/datanivra_sdk/_operations.py` is **generated** by `tools/gen_python_sdk.py` from
  `datanivra_contracts.api.API_ROUTES` (`make sdk`; `make contracts-check` fails when stale).
* `client.py` implements transport: bearer auth for user routes only, `Idempotency-Key`
  (re-sent unchanged on retries), retries **only** for retry-safe operations (GET, or POST with
  an idempotency key), `ApiError` mapping that never echoes non-`ApiError` bodies, and strict
  response validation against the contract models. The base URL must be `https://`; plain
  `http://` is refused for any non-loopback host (the token would travel unencrypted) unless
  `allow_insecure_http=True` is passed explicitly.
* `capacity.py` is the pure capacity planner (PERF-02); it prices scenarios with an injected
  estimator (`client.estimate_capacity` or the control plane's authoritative function).
* Drift tests: `tests/test_sdk_contract.py` (contract ⇄ OpenAPI ⇄ SDK methods ⇄ models),
  `tests/test_sdk_client.py` (transport behaviour), `tests/test_sdk_integration.py` (real
  composed control plane on embedded PostgreSQL).

The SDK only imports `datanivra_contracts` (ARCHITECTURE.md §3); it cannot reach connectors,
the engine or the agent protocol. See `apps/docs/content/sdk.md` for the user guide.
