Skip to main content

AXON document format — typed, deterministic, signable document archives. Powers tdoc (tdoc.xyz).

Project description

AXON — Document Format · powers tdoc (https://tdoc.xyz)

Deterministic, semantic, signable document archives. A clean break from PDF / DOCX / HTML.

  • Spec: AXON_Format_Specification.txt — v1.0 design draft.
  • Reference impl: axon.py — single-file Python reference (~1800 lines).
  • Demo: demo.py — runs the full pipeline end-to-end.
  • Product (commercial API on top): product/ — see product/README.md.

The AXON format vs the .tdoc file extension

  • AXON is the open format. Open spec, Apache-2.0 reference implementation. Anyone can build tools on it.
  • .tdoc is the standard file extension for AXON archives. A .tdoc file is an AXON archive.
  • Readers that support AXON also accept .axon for backwards compatibility.

Think of it like .png vs PNG: one is the file extension users see, the other is the open standard.

Status

Early-alpha reference. Spec is complete; implementation covers most of it and ships with 50 passing tests (32 format + 18 API) covering the load-bearing invariants. Landing is live at https://tdoc.xyz with Mozilla Observatory A+ · 125/125 · 10/10 tests.

Install

From PyPI (once published):

pip install axon-document           # → import axon
pip install axon-document[crypto]   # + Ed25519 signatures
pip install axon-document[pdf]      # + PyMuPDF PDF ingest
pip install axon-document[all]      # everything

From source (editable):

python3 -m venv .venv
.venv/bin/pip install -e ".[dev,crypto]"
.venv/bin/pytest tests/ product/tests/

Optional extras: [pdf], [fastjson], [crypto], [mathml], [all].

Quick start

from axon import convert_axc_string, encode_archive, decode_archive, render_html

doc = convert_axc_string("""
@section [id="hello"]:
  @heading [level=1]:
    Hello
  @paragraph:
    A deterministic document.
""", title="Hello", document_type="article.research")

encode_archive(doc, "hello.tdoc")  # .tdoc extension is the convention

loaded = decode_archive("hello.tdoc", verify=True)
print(render_html(loaded))

What's verified

As of the current test suite (pytest tests/):

Invariant Status
AXC parse ↔ serialise round-trip (Unicode, nested, attributes)
Archive byte-determinism — two encodes produce identical bytes
ZIP entries stamped with fixed epoch (not wall-clock)
encode_archive does not mutate manifest.modified
Content-hash tamper detection via validate()
verify_document rejects zeroed manifest hash
Ed25519 cryptographic signing + verification
ZIP-bomb + path-traversal defenses on decode
Spec conformance (accessibility warnings, dup-ids, hash mismatch)

32 tests, 0 xfail for the format. 18 additional tests for the tdoc API service (auth, quotas, security headers, rate limits). 50 total, all green.

License

Apache-2.0. See LICENSE.

Commercial

Hosted API, paid plans, and signing-as-a-service live at tdoc.xyz.

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

axon_document-0.1.0.tar.gz (31.6 kB view details)

Uploaded Source

Built Distribution

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

axon_document-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file axon_document-0.1.0.tar.gz.

File metadata

  • Download URL: axon_document-0.1.0.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for axon_document-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff09f0f0fb17950bf8c3323bc9391c59756d996f5a7ebf795533a74d09e2f9ce
MD5 af0da9d87e5e3216140ee30a81ae9f79
BLAKE2b-256 e67a9a7b385c22c0cd5f35f54d403d0b39317a34b890256f7e518165d740453d

See more details on using hashes here.

Provenance

The following attestation bundles were made for axon_document-0.1.0.tar.gz:

Publisher: publish-pypi.yml on LuciferMors/tdoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file axon_document-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: axon_document-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for axon_document-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccaee689efc0f4fbd1c8f1f200ec6223f845b772d4062cec19ac3946c7fd716c
MD5 a455fa77556e458d8b3c5d8cde6a0380
BLAKE2b-256 97250191ced0cc83a830658d152787e8db5926e886f24e3cd47842ae0e3db1fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for axon_document-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on LuciferMors/tdoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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