Skip to main content

Aura Graph Format for Python (aura-agf)

An independent, from-scratch implementation of AGF 0.1: read, write, validate, type-check, evaluate and translate typed mathematical documents. It shares no code with the reference Kotlin implementation — that is the point.

pip install aura-agf            # the import package is `auragf`, the command is `agf`
pip install "aura-agf[sympy]"   # + the SymPy bridge

The distribution is called aura-agf rather than agf because agf is already published on PyPI by an unrelated project (and installs a top-level agf module). A format implementation that shadows someone else's import is not a good citizen.

from auragf import load, validate, evaluate, to_latex

doc = load("canvas.agf.json")           # or auragf.loads(json_text)
for diagnostic in validate(doc):
    print(diagnostic)                   # W6 error: ... has type Relation, but exponent accepts ...
for root in doc.roots():
    print(to_latex(doc, root.id), "->", evaluate(doc, root.id))

Command line

The console script is agf (from the aura-agf distribution):

agf validate canvas.agf.json            # W1–W8 diagnostics, exit 1 on errors
agf show canvas.agf.json                # LaTeX and value for every component
agf eval canvas.agf.json --env x=4      # numbers, and true/false for relations
agf latex canvas.agf.json
agf sympy canvas.agf.json               # translate to a SymPy expression
agf conformance                         # run SPEC §9 classes against docs/conformance

What is implemented

SPEC Status
§2 data model, §8 codec (incl. unknown-member preservation) yes
§3 vocabulary: 8 kinds, 11 ports, variant-driven port sets yes
§4 type lattice and admissibility with expression widening yes
§5 well-formedness W1–W7 + W8 (unbound required port, warning) yes
§6 reference evaluation, including undefined vs NaN yes
§7 LaTeX projection yes (byte-identical to the reference on the corpus)
§9 C1–C6 conformance yes (C6 needs the test extra)
SymPy bridge (to_sympy / from_sympy) yes, optional extra

Not implemented: LaTeX parsing (that lives in the reference implementation today; a shared parser is the obvious next step for interoperability), ink recognition, and any layout logic.

Conformance results

PASS  C1 round-trip          30/30
PASS  C2 diagnostics         8/8
PASS  C2 severity            5/5
PASS  C2 well-formedness     30/30
PASS  C3 typing              30/30
PASS  C4 evaluation          30/30
PASS  C5 rewrite soundness   10/10
PASS  C6 schema              30/30
PASS  P7 latex projection    30/30

203 passed, 0 failed

The corpus (docs/conformance/) is generated from the reference implementation by tools/GenerateConformance.kt and committed, so these results are reproducible without a JVM.

Honest caveat

Both implementations were written by the same author. This exercises the specification (it has already forced two ambiguities to be resolved in the text) but it cannot catch a shared conceptual mistake. Independent third-party implementations are what would turn this into evidence of interoperability rather than evidence of self-consistency.

SymPy bridge

from auragf import load
from auragf.sympy_bridge import to_sympy

doc = load("canvas.agf.json")
expr = to_sympy(doc, doc.roots()[0].id)      # Eq(2*x + 3, 11)
import sympy
print(sympy.solve(expr, sympy.Symbol("x")))  # [4]

± is refused rather than guessed (it denotes a set of values), and unsupported constructs raise UnsupportedConstruct instead of silently producing something wrong.

Publishing (maintainers)

Releases publish from GitHub Actions via PyPI Trusted Publishing (OIDC) — no API token is stored anywhere, and none should ever be pasted into a chat, issue or commit. The one-time account setup and the exact field values PyPI asks for are in docs/publishing-pypi.md.

The flow, once that setup exists:

  1. Bump version in pyproject.toml and __version__ in src/auragf/__init__.py (a deleted PyPI release keeps its version number forever and cannot be re-uploaded — so never reuse a number).
  2. Dry run: GitHub → Actions → Publish to PyPI → Run workflow → target testpypi. Verify with pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ aura-agf.
  3. For real: GitHub → Releases → new release with tag aura-agf-vX.Y.Z (matching pyproject.toml). The workflow tests, builds, runs twine check, and publishes.

python/LICENSE is a verbatim copy of the repository LICENSE so the sdist and wheel carry the licence text; the publish workflow fails if the two ever drift apart.

A manual twine upload from a maintainer's own machine (token in your environment only) remains a fallback, but the workflow is the supported route.

Metadata

Release files for aura-agf 0.1.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 aura-agf 0.1.0
File Size Uploaded Provenance
aura_agf-0.1.0.tar.gz 31.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aura-agf 0.1.0
File Interpreter ABI Platform
aura_agf-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.2 kB

Release files / aura_agf-0.1.0.tar.gz

Download URL aura_agf-0.1.0.tar.gz
Size 31.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ab48709f76b97064d31b91296c9527d4741f886c2df977db3e1330c887813e98
BLAKE2b-256 checksum
How to use checksums
ba6d3f8044f94f62cf1f9c62607efee874ea681f0ca09b2f071ed045d2596c66
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 Oct 26, 2026.

Transparency log

Release files / aura_agf-0.1.0-py3-none-any.whl

Download URL aura_agf-0.1.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abcab3f9ff43700ecce10006de7c78f4285137c67a9228c70ab34ec0d90fd0ff
BLAKE2b-256 checksum
How to use checksums
f8f679c25e7d3e7f1277b88906c5f27955001bdf89e6d1100313eb575bb6e737
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 Oct 26, 2026.

Transparency log

Security for aura-agf 0.1.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aura_agf-0.1.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 Oct 26, 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.1.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