Metadata-Version: 2.4
Name: dna-sdk
Version: 0.9.0
Summary: DNA — Domain Notation of Anything: microkernel + extensions for declarative agent notation
Project-URL: Homepage, https://ruinosus.github.io/dna/
Project-URL: Repository, https://github.com/ruinosus/dna
Project-URL: Documentation, https://ruinosus.github.io/dna/
Project-URL: Changelog, https://github.com/ruinosus/dna/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/ruinosus/dna/issues
License-Expression: MIT
License-File: LICENSE
Keywords: agents,declarative,dna,manifests,microkernel,prompts,sdlc,skills
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.12
Requires-Dist: aiofiles>=24.1
Requires-Dist: chevron>=0.14
Requires-Dist: jsonschema>=4.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: typing-extensions>=4.4; python_version < '3.13'
Provides-Extra: all
Requires-Dist: aiosqlite>=0.20; extra == 'all'
Requires-Dist: asyncpg>=0.29; extra == 'all'
Requires-Dist: boto3>=1.28; extra == 'all'
Requires-Dist: redis>=5.0; extra == 'all'
Requires-Dist: sqlalchemy[asyncio]>=2; extra == 'all'
Provides-Extra: dev
Requires-Dist: aiosqlite>=0.20; extra == 'dev'
Requires-Dist: asyncpg>=0.29; extra == 'dev'
Requires-Dist: boto3>=1.28; extra == 'dev'
Requires-Dist: httpx>=0.24; extra == 'dev'
Requires-Dist: moto>=5.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest-timeout>=2.0; extra == 'dev'
Requires-Dist: pytest-xdist>=3.6; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: redis>=5.0; extra == 'dev'
Requires-Dist: sqlalchemy[asyncio]>=2; extra == 'dev'
Requires-Dist: sqlite-vec>=0.1.6; extra == 'dev'
Provides-Extra: embed-onnx
Requires-Dist: fastembed>=0.3; extra == 'embed-onnx'
Provides-Extra: postgres
Requires-Dist: asyncpg>=0.29; extra == 'postgres'
Requires-Dist: sqlalchemy[asyncio]>=2; extra == 'postgres'
Provides-Extra: redis
Requires-Dist: redis>=5.0; extra == 'redis'
Provides-Extra: s3
Requires-Dist: boto3>=1.28; extra == 's3'
Provides-Extra: safety-ml
Requires-Dist: detoxify>=0.5; extra == 'safety-ml'
Requires-Dist: presidio-analyzer>=2.2; extra == 'safety-ml'
Requires-Dist: presidio-anonymizer>=2.2; extra == 'safety-ml'
Requires-Dist: spacy>=3.7; extra == 'safety-ml'
Provides-Extra: search-pgvector
Requires-Dist: asyncpg>=0.29; extra == 'search-pgvector'
Requires-Dist: sqlalchemy[asyncio]>=2; extra == 'search-pgvector'
Provides-Extra: search-sqlite
Requires-Dist: sqlite-vec>=0.1.6; extra == 'search-sqlite'
Provides-Extra: sql
Requires-Dist: aiosqlite>=0.20; extra == 'sql'
Requires-Dist: asyncpg>=0.29; extra == 'sql'
Requires-Dist: sqlalchemy[asyncio]>=2; extra == 'sql'
Provides-Extra: sqlite
Requires-Dist: aiosqlite>=0.20; extra == 'sqlite'
Requires-Dist: sqlalchemy[asyncio]>=2; extra == 'sqlite'
Provides-Extra: tools
Requires-Dist: langchain-core<2,>=1.4; extra == 'tools'
Description-Content-Type: text/markdown

# dna-sdk (Python)

Python SDK for **DNA — Domain Notation of Anything**: a microkernel +
extensions runtime for declarative agent notation. See the
[repository README](https://github.com/ruinosus/dna#readme) for the thesis, the architecture and
the full Kind catalog.

## Install

```bash
pip install dna-sdk        # or: uv add dna-sdk
```

Pre-release / exact-pin alternative — from the repo:

```bash
cd packages/sdk-py
uv sync            # or: pip install -e .
```

Optional extras: `postgres`, `sqlite`, `sql` (SqlAlchemySource — one
adapter for both SQL dialects, same tables; see docs/PORT-CONTRACT.md
§ "Using the SQLAlchemy adapter"), `redis`, `s3`, `tools`
(langchain `@dna_tool` decorator), `safety-ml` (PII/toxicity models),
`all`, `dev`.

## Minimal example

```python
from dna import Kernel

# Scan a scope (directory of YAML/Markdown manifests under .dna/)
mi = Kernel.quick("hello-genome", base_dir="examples/hello-genome/.dna")

# Every document is identified by (apiVersion, kind, name)
for d in mi.documents:
    print(d.api_version, d.kind, d.name)

# Compose agent + soul + skills + guardrails into one system prompt
print(mi.build_prompt(agent="greeter"))
```

Runnable version: [`examples/hello-genome/run.py`](https://github.com/ruinosus/dna/blob/main/examples/hello-genome/run.py).

## Layout

```
dna/
├── kernel/       # Kernel (mediator over 5 ports), Document, ManifestInstance
├── adapters/     # filesystem (core); sqlite/postgres/sqlalchemy_/redis/s3 via extras
├── extensions/   # helix (core Kinds) + market formats + governance
├── sync/         # lockfile + document hashing
└── safety/       # safety pipeline (optional ML extras)
```

## Tests

```bash
uv run pytest tests/ -v
```

The suite includes the market-fidelity conformance tests
(`tests/test_market_conformance.py`) and the Py↔TS parity fixtures shared
with the TypeScript twin.
