Metadata-Version: 2.5
Name: nanorix
Version: 0.6.0
Summary: Python SDK for Nanorix — sealed ephemeral capsules for regulated data, with independently verifiable AuditProofs
Project-URL: Homepage, https://nanorix.io
Project-URL: Documentation, https://docs.nanorix.io
Project-URL: Repository, https://github.com/nanorix-io/nanorix-sdk
Project-URL: Issues, https://github.com/nanorix-io/nanorix-sdk/issues
Author-email: "Nanorix Inc." <support@nanorix.io>
License: Apache-2.0
License-File: LICENSE
Keywords: compliance,cryptographic-proof,data-destruction,gdpr,hipaa,nanorix,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: cryptography<51.0.0,>=50.0.0
Requires-Dist: httpx<1.0.0,>=0.25.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
Provides-Extra: airflow
Requires-Dist: apache-airflow>=2.7; extra == 'airflow'
Provides-Extra: anecdotes
Requires-Dist: requests>=2.31; extra == 'anecdotes'
Provides-Extra: autogen
Requires-Dist: autogen-agentchat>=0.4; extra == 'autogen'
Provides-Extra: ccda
Requires-Dist: lxml>=4.9; extra == 'ccda'
Provides-Extra: crewai
Requires-Dist: crewai>=0.30; extra == 'crewai'
Provides-Extra: datadog
Requires-Dist: datadog-api-client>=2.20; extra == 'datadog'
Requires-Dist: datadog>=0.50; extra == 'datadog'
Provides-Extra: dev
Requires-Dist: hypothesis>=6.0; extra == 'dev'
Requires-Dist: mypy<2.0,>=1.18; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff<0.17,>=0.16; extra == 'dev'
Provides-Extra: dicom-sr
Requires-Dist: pydicom>=2.4; extra == 'dicom-sr'
Provides-Extra: dicomweb
Requires-Dist: dicomweb-client>=0.59; extra == 'dicomweb'
Provides-Extra: drata
Requires-Dist: requests>=2.31; extra == 'drata'
Provides-Extra: epic-smart
Requires-Dist: python-jose[cryptography]>=3.3; extra == 'epic-smart'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100; extra == 'fastapi'
Requires-Dist: starlette>=0.36; extra == 'fastapi'
Provides-Extra: flask
Requires-Dist: flask>=2.0; extra == 'flask'
Provides-Extra: gcs
Requires-Dist: google-cloud-storage>=2.14; extra == 'gcs'
Provides-Extra: grc
Requires-Dist: requests>=2.31; extra == 'grc'
Requires-Dist: vanta-api>=0.1; extra == 'grc'
Provides-Extra: hl7-v2
Requires-Dist: hl7apy>=1.3; extra == 'hl7-v2'
Provides-Extra: honeycomb
Requires-Dist: opentelemetry-api>=1.27; extra == 'honeycomb'
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27; extra == 'honeycomb'
Requires-Dist: opentelemetry-sdk>=1.27; extra == 'honeycomb'
Provides-Extra: jupyter
Requires-Dist: ipython>=8.0; extra == 'jupyter'
Provides-Extra: langchain
Requires-Dist: langchain-core<2.0,>=0.3; extra == 'langchain'
Provides-Extra: langgraph
Requires-Dist: langgraph<2.0,>=0.2; extra == 'langgraph'
Provides-Extra: litellm
Requires-Dist: litellm<2.0,>=1.40; extra == 'litellm'
Provides-Extra: llama-index
Requires-Dist: llama-index-core<1.0,>=0.11; extra == 'llama-index'
Provides-Extra: observability
Requires-Dist: datadog-api-client>=2.20; extra == 'observability'
Requires-Dist: datadog>=0.50; extra == 'observability'
Requires-Dist: opentelemetry-api>=1.27; extra == 'observability'
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27; extra == 'observability'
Requires-Dist: opentelemetry-sdk>=1.27; extra == 'observability'
Requires-Dist: requests>=2.31; extra == 'observability'
Requires-Dist: sentry-sdk>=2.0; extra == 'observability'
Provides-Extra: otel-genai
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel-genai'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel-genai'
Provides-Extra: s3
Requires-Dist: boto3>=1.34; extra == 's3'
Provides-Extra: sentry
Requires-Dist: sentry-sdk>=2.0; extra == 'sentry'
Provides-Extra: splunk
Requires-Dist: requests>=2.31; extra == 'splunk'
Provides-Extra: temporal
Requires-Dist: temporalio>=1.5; extra == 'temporal'
Provides-Extra: vanta
Requires-Dist: vanta-api>=0.1; extra == 'vanta'
Description-Content-Type: text/markdown

# Nanorix Python SDK

Sealed ephemeral capsules for regulated data, with independently verifiable AuditProofs.

## Installation

```bash
pip install nanorix
```

## Quick Start

```python
import nanorix

client = nanorix.Client(api_key="nrx_live_...")

# Create a capsulefile (one-time setup)
capsulefile = client.capsulefiles.create(
    name="patient-risk-scorer",
    runtime="python3.11",
    entrypoint="python model.py",
    files=["model.py", "requirements.txt"],
)
client.capsulefiles.wait_until_finalized(capsulefile.id)

# Process data — capsule auto-destroyed after completion
outputs, cdp = client.capsules.run(
    capsulefile=capsulefile.id,
    inputs={"patient.csv": open("patient.csv", "rb")},
)

# The proof
print(cdp.verify_url)  # https://nanorix.io/verify/cap_...
```

## Workspace Mode

For multi-step workflows with full control:

```python
capsule = client.capsules.create(capsulefile="cf_...")

capsule.upload("patient.csv", data)
capsule.execute("python preprocess.py")
capsule.execute("python model.py")

prediction = capsule.download("prediction.json")
cdp = capsule.destroy()

# Share the proof with auditors
verification = cdp.verification()
```

## AuditProof Access

Every destroyed capsule produces an AuditProof covering the full lifecycle —
ingress, execution, egress, and destruction:

```python
# AuditRecord — your private audit trail
full = cdp.full()
print(full.activity)       # Complete event timeline
print(full.destruction)    # 8-step chain verification

# AuditProof — safe to share
verify = cdp.verification()
print(verify.data_ingested)   # File count and hashes only
print(verify.residency)       # How long data existed
# Zero filenames, commands, or operational details
```

## Error Handling

```python
from nanorix import ExecutionError, TimeoutError

try:
    outputs, cdp = client.capsules.run(capsulefile="cf_...", inputs=inputs)
except ExecutionError as e:
    print(f"Exit code: {e.exit_code}")
    print(f"CDP still generated: {e.cdp}")  # Destruction happened
except TimeoutError as e:
    print(f"Capsule still alive: {e.capsule.id}")
    # Decide: retry, debug, or destroy
```

## Async Support

```python
import nanorix

async with nanorix.AsyncClient(api_key="nrx_live_...") as client:
    outputs, cdp = await client.capsules.run(
        capsulefile="cf_...",
        inputs={"data.csv": data},
    )
```

## Configuration

```python
client = nanorix.Client(
    api_key="nrx_live_...",
    base_url="https://api.nanorix.io",  # default
    timeout=30.0,                        # default
    max_retries=3,                       # default
)
```

## Documentation

- [Verify an AuditProof](https://nanorix.io/verify/)
- [Console](https://app.nanorix.io)
- [Verify an AuditProof](https://nanorix.io/verify)
