Metadata-Version: 2.4
Name: datanature-sdk
Version: 0.1.0
Summary: DataNature DS/DE SDK — tenant-safe client for the sdk-layer service.
Project-URL: Documentation, https://github.com/dlytica-gcp/datanature-paas-base/blob/main/docs/sdk/SDK-USE-CASES.md
Project-URL: Source, https://github.com/dlytica-gcp/datanature-paas-base/tree/main/sdk/python
Project-URL: Changelog, https://github.com/dlytica-gcp/datanature-paas-base/blob/main/sdk/python/CHANGELOG.md
Author: DataNature
License: Proprietary
Keywords: data-engineering,data-science,datanature,dbt,iceberg,sdk,spark
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Provides-Extra: pandas
Requires-Dist: pandas>=2.0; extra == 'pandas'
Provides-Extra: spark
Requires-Dist: pyspark>=3.5; extra == 'spark'
Description-Content-Type: text/markdown

# datanature-sdk (Python)

Tenant-safe DS/DE client for the DataNature `sdk-layer` service. Marketplace artifact
(Track B). Full design: [`docs/sdk/SDK-PLAN.md`](../../docs/sdk/SDK-PLAN.md); usage:
[`docs/sdk/SDK-USE-CASES.md`](../../docs/sdk/SDK-USE-CASES.md).

```python
from datanature import Client

# machine / notebook / CI
c = Client("https://sdk.platform.dlytica.com", workspace_id="09588140-...",
           api_key="vmk_09588140_...")
# or interactive session token
c = Client.login("https://sdk.platform.dlytica.com", workspace_id="09588140-...",
                 token="<platform session token>")

c.version()          # sdk-layer API version
c.capabilities()     # DS/DE surfaces this workspace's plan entitles
c.de.query.run(...)  # DE surfaces (SDK-06..09)   — land per bead
c.ds.spark.session() # DS surfaces (SDK-10)        — land per bead
```

## Design guarantees
- **One `Client` == one workspace.** `workspace_id` is fixed at construction; every path is
  built from it (`Client._tenant_path`). No API targets another tenant. The service still
  re-enforces `require_tenant_match` (defense in depth).
- **Typed errors.** HTTP status → `AuthError`/`PermissionError_`/`NotFoundError`/`QuotaError`/`ServiceError`.
- **Honest surfaces.** Not-yet-implemented capabilities raise `NotImplementedYet` with their
  tracking bead — never fake behavior.
- **Resilient transport.** Idempotent GETs retry on 429/5xx with capped backoff.

## Layout
```
datanature/
  client.py       Client + tenant-safety core (SDK-05)
  auth.py         SessionTokenAuth / ApiKeyAuth (SDK-04)
  transport.py    httpx wrapper: retries, pagination, error mapping (SDK-03)
  errors.py       typed error hierarchy
  de/  ds/  governance/   capability namespaces (surfaces land per bead)
tests/            offline tests via httpx.MockTransport
```

## Develop
```bash
cd sdk/python
pip install -e ".[dev]"
PYTHONPATH=. pytest tests/ -q
```