Skip to main content

Canonical YAML schemas for Runlog entries and session manifests

Project description

runlog-schema (Python)

Canonical Runlog schemas (entry + session manifest) packaged for Python. Mirrors the Go module github.com/runlog-org/runlog-schema so Python consumers don't need to do filesystem-path arithmetic against a sibling clone.

Part of the Runlog project. The canonical YAML lives at the repo root (entry.schema.yaml, manifest.schema.yaml); this package bundles a CI-gated copy under runlog_schema/_data/.

Install

Once published to PyPI (separate slice — see [F28] in the project TODO):

pip install runlog-schema

For now, install from the source tree:

pip install ./generators/python   # from runlog-schema repo root

Use

from runlog_schema import (
    entry_schema_yaml,
    manifest_schema_yaml,
    entry_schema_json,
    manifest_schema_json,
    schema_version,
    SCHEMA_VERSION,
)

# Raw YAML bytes (the canonical source form):
entry_yaml = entry_schema_yaml()

# JSON bytes for libraries that don't accept YAML
# (e.g. `jsonschema.Draft202012Validator`):
import json
from jsonschema import Draft202012Validator

doc = json.loads(entry_schema_json())
Draft202012Validator.check_schema(doc)

assert schema_version() == SCHEMA_VERSION == "0.1.0"

API parity with the Go module

Go Python
EntrySchemaYAML() []byte entry_schema_yaml()
ManifestSchemaYAML() []byte manifest_schema_yaml()
EntrySchemaJSON() entry_schema_json()
ManifestSchemaJSON() manifest_schema_json()
SchemaVersion() string schema_version()
SchemaVersionConst SCHEMA_VERSION

Both modules compile from the same canonical YAML files at the repo root. Commit-time CI ensures the bundled copies under runlog_schema/_data/ match those canonical files byte-for-byte; if you edit either schema, run:

cd generators/python
./scripts/sync_schemas.sh

…then commit the updated _data/ copies alongside your schema edit.

Develop

cd generators/python

# Editable install with test extras:
uv pip install -e '.[test]'   # or: pip install -e '.[test]'

# Run the tests:
pytest -v

Python ≥3.10 is supported (matches the server's pinned floor; 3.12 is what production runs). The package uses importlib.resources.files(), stable since Python 3.9.

Build backend

hatchling — the modern uv-friendly default. See pyproject.toml.

License

Apache-2.0 — same as the canonical schemas. See ../../LICENSE.

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

runlog_schema-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

runlog_schema-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for runlog_schema-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8ebbe9f6760a023d0969d7db8d8e933064ab77ee07139724e433392e2e6aa76d
MD5 053564c20afe1455ffe903f9e92f691a
BLAKE2b-256 2881708b14a154b1539fb7ab5a7531db3bc2f2c884a386e64be41d028ac1bc51

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for runlog_schema-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5242220cae713e2e4b31a696be5684e1c168fe2e0a4c7530cb6c73c0bbc11130
MD5 57b67425036fee24e977512ff33abf76
BLAKE2b-256 5b725cde1167480f8ed0dc06b68aa1ac624ba09c2fa25a54f0b0fb73245e15a6

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