Skip to main content

odkn — Open Data Knowledge Network Python SDK, CLI & Offline MCP Server

License: Apache-2.0 Python 3.11+

Reference Python SDK, structural validator, offline Ed25519 DSSE v1.0 cryptographic verifier, deterministic distribution profiler, and Model Context Protocol (MCP) stdio server for the Open Data Knowledge Network (ODKN) layered over Open Knowledge Format (OKF v0.3).

Installation

pip install odkn

Runtime dependencies are minimal and strictly offline (pyyaml, jsonschema, cryptography, click).

Quickstart

1. Python SDK (ODKNClient & BundleVerifier)

from odkn import MinTrustProfile, ODKNClient

client = ODKNClient(min_trust=MinTrustProfile.PRODUCTION, allow_default_paths=False)

# Single-pass structural + cryptographic validation
findings = client.validate("./my-bundle", verify=True, check_crosswalk=True)

# Fail-closed Verified Execution Plan & anti-TOCTOU asset reads
verifier = client.open("./my-bundle")
plan = verifier.verify_concept("datasets/mobility")
if plan.ok:
    raw_contract = verifier.read_verified_asset("datasets/mobility", "datasets/contract.json")

2. Command-Line Interface (odkn / python -m odkn)

# Validate Layer 1/2/3 structure, TLP visibility lattice, and crosswalks
odkn validate ./my-bundle --verify --min-trust production --check-crosswalk --json

# Sign concepts, access/policy layers, index.md, and monotonic snapshot.sig.json
odkn sign ./my-bundle --key ./ed25519-priv.pem --all --generation 1

# Profile local CSV distributions offline into .odkn/drift/
odkn profile ./my-bundle --json

# Serve verified bundle concepts over 100% offline JSON-RPC 2.0 MCP stdio
odkn mcp serve --bundle ./my-bundle --min-trust production

Architecture & Security Guarantees

  • Cosmic Python Hexagonal + Tactical DDD Layout: Pure zero-I/O odkn.domain (6 immutable Value Objects, 12 StrEnums, @runtime_checkable Driven Port Protocols, MemoryBundle), port-injected odkn.application workflows, confined odkn.adapters (YAML 1.2 Core Schema, O_NOFOLLOW filesystem reads, zip-bomb-guarded archives, Ed25519 DSSE, locked anti-rollback snapshot store), and thin odkn.entrypoints (CLI, ODKNClient, MCPServer).
  • 100% Offline & Fail-Closed: Zero network sockets opened during validation, signing, profiling, or MCP serving; session-wide uniform anti-oracle error masking for restricted (TLP:AMBER / TLP:AMBER+STRICT / L2 / L3) bundles.
  • PEP 561 Typed (py.typed): Full static type annotations across all 88 root exports and 15 legacy compatibility shims.

Metadata

Release files for odkn 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for odkn 0.5.0
File Size Uploaded Provenance Actions
odkn-0.5.0.tar.gz 114.4 kB With provenance Details for odkn-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for odkn 0.5.0
File Interpreter ABI Platform Actions
odkn-0.5.0-py3-none-any.whl Python 3 none any Details for odkn-0.5.0-py3-none-any.whl

Total release size: 248.1 kB

Release files / odkn-0.5.0.tar.gz

Download URL odkn-0.5.0.tar.gz
Size 114.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b710a982277e5998f15aba957cb40c1a01c60a44bf2eb205830f0efbbb89e536
BLAKE2b-256 checksum
How to use checksums
86d2211cc070c0bc16b8bcd9cbbe97fde43452eb5ef1d04af80194d10fc45b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

Release files / odkn-0.5.0-py3-none-any.whl

Download URL odkn-0.5.0-py3-none-any.whl
Size 133.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9394b6095fe7d07711ba5432330656f9c98bf4e8bc836bc55e40930ce056ee18
BLAKE2b-256 checksum
How to use checksums
2e782a4bba4881dbfa26227de4e3ba55bfdba53087f67e4f9c2b1729dacaf97a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

Security for odkn 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for odkn-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page