Skip to main content

DataNature DS/DE SDK — tenant-safe client for the sdk-layer service.

Project description

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; usage: docs/sdk/SDK-USE-CASES.md.

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datanature_sdk-0.2.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datanature_sdk-0.2.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file datanature_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: datanature_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.16

File hashes

Hashes for datanature_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fe196e4ef17e38bb9e0caa22997faf86631ece444029d140aec390038fc05d93
MD5 80e639e3387f90ddc72e84085cf16105
BLAKE2b-256 4178e31991301ea14913cf59de1bf5bac17999aab5a5baa9039c08abdc654801

See more details on using hashes here.

File details

Details for the file datanature_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: datanature_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.16

File hashes

Hashes for datanature_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44da35bc31929e8cb2e145df966ac7635514e4c9bae6e6bc3929ef03a6fc381d
MD5 a140ebb1158850556dfbabf37f93196d
BLAKE2b-256 3d76c76e630b8ceb6733c5830b926cef067383f5266525183d5803ef05b4439d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page