Skip to main content

acid-cat-catalog

The AcidCat catalog library for Python, published on PyPI as acid-cat-catalog. Build a catalog in code and write it in canonical form. The library uses only the standard library. Use it at build time to write acidcat.catalog.json.

Install

pip install acid-cat-catalog

Example

from pathlib import Path
from acid_cat_catalog import Catalog

catalog = Catalog(title="Hilltop weather station")
catalog.target("logger", surfaces=["http"])
fault = catalog.type("SensorFault", {"type": "object"})
catalog.capability(
    "weather.sensor.calibrate",
    description="Correct one sensor by a fixed offset.",
    audience=["logger"],
    input={"type": "object", "required": ["offset"], "properties": {"offset": {"type": "number"}}},
    failures={"SensorFault": fault},
)
catalog.event(
    "weather.alert.raised",
    description="A reading passed a limit. The occurrence gives the reading.",
    audience=["logger"],
    input={"type": "object", "properties": {}},
    payload={"type": "object", "properties": {"celsius": {"type": "number"}}},
)

Path("acidcat.catalog.json").write_text(catalog.render())

The full example, a weather station, is examples/weather.py.

API

  • event() declares an event. Clients subscribe to it and get its payload in each occurrence. A payload is an object, or a reference to a type that is an object.
  • read_only, destructive and idempotent are a capability's hints for clients. A hint you leave out is not in the catalog.
  • validate() lists the rules that the catalog breaks. render() raises CatalogError for a catalog that breaks any rule.

Tests

Run moon run catalog-python:test. The tests compare the library's output, byte for byte, with these files:

File Contents
examples/weather.acidcat.json The weather-station catalog
../testdata/canonical.acidcat.json The canonical form of ../testdata/canonical.json: values that languages write differently by default
../testdata/hints.acidcat.json Each hint of a capability, in canonical order

The air-conditioner example writes its catalog with this library in examples/aircon/catalog/python.py, and its test compares the output with the Pkl catalog. The root moon run check checks that each committed catalog file is in canonical form.

Metadata

Release files for acid-cat-catalog 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 acid-cat-catalog 0.5.0
File Size Uploaded Provenance Actions
acid_cat_catalog-0.5.0.tar.gz 6.3 kB With provenance Details for acid_cat_catalog-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 13.6 kB

Release files / acid_cat_catalog-0.5.0.tar.gz

Download URL acid_cat_catalog-0.5.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e9cff160214806b5ed6a224357636e15d03190214826d31819a880d92340b227
BLAKE2b-256 checksum
How to use checksums
2eeb100819a3becbbe087bb8d629899ba33e75b0fb0373573ca700fdfdabc0ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 24, 2026.

Transparency log

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

Download URL acid_cat_catalog-0.5.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa3d54c8810909ef62193631138ea6743892943df06c38c00f16dc67df97cd18
BLAKE2b-256 checksum
How to use checksums
c8b666a4fa363eeeab228f05de2c839269a7d49a5436eaa2792e3011c94bed0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 24, 2026.

Transparency log

Security for acid-cat-catalog 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 acid_cat_catalog-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 Nov 24, 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.

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