Skip to main content

The Python binding of the Causalontology standard - a verb-first noun-hosting ontology; a language-neutral standard and shared commons for reified causation. Zero dependencies: RFC 8785 canonicalization, SHA-256 identity, pure-Python Ed25519 (RFC 8032), schema and semantics validation, and an in-memory conformant store.

Project description

causalontology-py

The second implementation of the Causalontology standard — the proof of language independence. (The first is the PrologAI reference implementation.)

Zero dependencies — Python standard library only:

Module Implements
causalontology.canonical RFC 8785 (JSON Canonicalization Scheme) serialization, identity-bearing field filtering, SHA-256 content-addressed identify()
causalontology.ed25519 pure-Python Ed25519 (RFC 8032), verified against the RFC's known-answer test
causalontology.signing record-level sign_record() / verify_record() over canonical identity-bearing bytes
causalontology.schema validation against the eight JSON Schemas in spec/schema/
causalontology.semantics the 13 semantic rules: temporal admissibility (fixed constants), formal conflict, refinement validity, hierarchy reachability, enrichment field/shape rules
causalontology.store an in-memory conformant store: idempotent immutable puts, signed add-only records, materialized enrichment views with contributors, retraction and succession lineage, the resolve minimum, the deterministic cycle-breaking view rule, and the stigmergy gaps() read

Conformance

$ python3 tests/run_conformance.py
...
38/38 vectors passed
causalontology-py is CONFORMANT to the suite (vectors frozen at specification 1.0.0).

The vectors are frozen at specification 1.0.0 (2026-07-13): they carry concrete identifiers, real keys, and a real verifying signature. The harness's old normalization now simply passes frozen values through.

Thirty-second taste

from causalontology import identify, InMemoryStore, keypair_from_seed, sign_record
import hashlib

store = InMemoryStore()
press = store.put({"type": "occurrent", "label": "press_button", "category": "action"})
light = store.put({"type": "occurrent", "label": "light_on", "category": "state_change"})
claim = store.put({"type": "cro", "causes": [press], "effects": [light]})

print(store.gaps("missing_field"))   # the degenerate claim is a visible invitation

sk, source = keypair_from_seed(hashlib.sha256(b"alice").digest())
store.put_record(sign_record({"type": "assertion", "about": claim,
                              "source": source, "evidence_type": "imported",
                              "confidence": 0.5,
                              "timestamp": "2026-07-13T00:00:00Z"}, sk))

License: "The attribution always; no profit, no problem license." — see the repository LICENSE and NOTICE.

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

causalontology-1.0.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

causalontology-1.0.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file causalontology-1.0.0.tar.gz.

File metadata

  • Download URL: causalontology-1.0.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for causalontology-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d17a1fbeb5151bd31b44ad35ab2d8142e826f8d9e1b1cb3b25cb73fb729b5958
MD5 a69e0e36f2a691f374da96f749440a36
BLAKE2b-256 f429a5b7aa792b683e7a02c35ca98b78601efae2d8f215d9b97005e05e32076c

See more details on using hashes here.

File details

Details for the file causalontology-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: causalontology-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for causalontology-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 128578ea63754cbaed3e5280f61905b68263139aec2c60e7a82bbf2a00480745
MD5 85ea0d4dc27fedec88b15feb292bc3f7
BLAKE2b-256 4b71d9251af7b577ae3756a24ae8b2d857d0604017becb881761bca0beaf1874

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