Skip to main content

ampack for Python

Verify and read ampack memory packs: knowledge, ontologies and minds for AI agents, in one signed file that is checked where it lands.

This is a preview (0.1.0). It verifies and reads. It does not build, sign or certify a pack.

pip install ampack

Needs Python 3.12 and the cryptography package.

Verify a pack

A pack is accepted only when a key in your trust policy signed it as publisher for its id.

ampack verify notes.ampack trust.json

Exit code 0 means verified, 1 refused (with the reason on the line), 2 a usage error or a defect.

Read a pack

import ampack

try:
    pack = ampack.load("notes.ampack", trust="trust.json")
except ampack.Refused as reason:
    raise SystemExit(f"not loaded: {reason}")

print(pack.id, pack.version, pack.digest, pack.kind)
print(pack.card["intendedUse"] if pack.card else "no card")

for record in pack.records():
    print(record.type, record.key, dict(record.properties))

for member in pack.members:          # a pack set carries several packs
    print(member.id, member.kind)

Nothing is returned from a pack that did not verify. pack, trust and each revocation document may be a path or the bytes themselves. ampack.verify(...) gives the verdict alone.

What it checks, and what it does not

  • Checked, as the specification says: the strict archive, every file's length and SHA-256 against the signed list, the signatures against the trust policy (key scopes, roles, validity windows, revocations), pack.json, the card, composites and their locks, pack sets and each member, embeddings, the usage policy's read door.
  • Checked on each record line: its shape only. An object with a string type and key, properties as an object, links as {"relation", "target"} pairs, no field the format does not define, and a knowledge pack's limits (5,000 records, 16 files, 64 KiB a line).
  • Not checked by this reader: whether a record fits the pack's ontology (its type, required properties, relations), and how deeply a record nests. A host that imports records checks those.
  • Handed out: only the files the pack's digest covers. The signatures and the attestations (certificates, erasure statements) travel beside them and are not handed out as the pack's files: verifying a pack does not make an attestation trusted.

The verifier is the Python verifier of the format's conformance kit, unchanged. It shares no code with the .NET and Rust verifiers, and must reach the same verdict as they do on every conformance vector.

Why Python 3.12 only

The format decides whether text is normalized with Unicode 15.0 data. Python 3.12 carries exactly that version; other versions carry another, and could give another verdict on the same pack. A later release will remove this limit.

Apache-2.0. Patent pending (Swiss application CH001531/2026); see PATENTS.md in the repository for the proposed pledge.

Metadata

Release files for ampack 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 ampack 0.1.0
File Size Uploaded Provenance Actions
ampack-0.1.0.tar.gz 51.4 kB With provenance Details for ampack-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 103.5 kB

Release files / ampack-0.1.0.tar.gz

Download URL ampack-0.1.0.tar.gz
Size 51.4 kB
Tags Source
SHA-256 checksum
How to use checksums
795198ee78958bf0aa06d0087583bf3bd16d2bfde84376d4cf4b029abe5da5c5
BLAKE2b-256 checksum
How to use checksums
90399b38352a0f87120cae9b9c2f50ce7cea6c788ab66009cb6eb1a6843288aa
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 Nov 22, 2026.

Transparency log

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

Download URL ampack-0.1.0-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c127ede087418b3a104bda4af3faf40e969174568c99872ade74e3e1f0a81058
BLAKE2b-256 checksum
How to use checksums
55b64a364d08a90aa18e063929c39184c29ef9c59a8d4d08060ef92431aae70d
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 Nov 22, 2026.

Transparency log

Security for ampack 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

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

Select from 2 files

Attestation for ampack-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 Nov 22, 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