Skip to main content

Cross-language metadata standard: declare typed entities once, generate idiomatic drift-checked code across languages — Python port.

Project description

MetaObjects (Python)

The Python port of the MetaObjects cross-language metadata standard: declare your typed entity model once, then generate idiomatic, drift-checked code across TypeScript, Java, C#, Python, and Kotlin. The metamodel is the durable spine; generated code is the disposable artifact.

Behavior is verified byte-for-byte against the same shared conformance corpora as every other language port.

Install

pip install metaobjects

Requires Python 3.11+. The only runtime dependency is PyYAML.

Quick start

Load a directory of metadata (*.json canonical or sigil-free *.yaml):

from metaobjects import load_directory

result = load_directory("metaobjects/")   # your *.json / *.yaml metadata files

if result.errors:
    for err in result.errors:
        print(err)          # structured MetaError with a stable ErrorCode
else:
    root = result.root      # the merged metadata tree (a MetaData node)
    print(root)

load_directory, load_uris, and load_string are module-level shortcuts over MetaDataLoader; all return a LoadResult with the same field shape as the other ports.

What's in the package

The primary public API is the loader (load_directory / load_uris / load_string, MetaDataLoader, LoadResult, ErrorCode, MetaError). The distribution also ships the Python implementations of the other pillars used by the CLI and tooling: codegen (Pydantic + FastAPI emit), render (Mustache + payload-VO + verify), runtime (SQLAlchemy-Core object manager), and migrate.

Authoring formats

  • Canonical JSON (*.json) — the cross-language interchange shape.
  • Sigil-free YAML (*.yaml / *.yml) — the AI-first authoring front-end (ADR-0006). Desugared to canonical JSON at load time. A directory may mix both freely.

AI assistant context

To scaffold MetaObjects context files (.metaobjects/AGENTS.md, .metaobjects/CLAUDE.md, and .claude/skills/metaobjects-*/) into your project so your AI assistant understands how to author metadata and run codegen, use the Node meta CLI:

npx meta agent-docs --server python

(Running metaobjects agent-docs in the Python CLI prints this redirect and exits.)

Links

License

Apache-2.0. 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

metaobjects-0.12.1.tar.gz (503.1 kB view details)

Uploaded Source

Built Distribution

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

metaobjects-0.12.1-py3-none-any.whl (362.4 kB view details)

Uploaded Python 3

File details

Details for the file metaobjects-0.12.1.tar.gz.

File metadata

  • Download URL: metaobjects-0.12.1.tar.gz
  • Upload date:
  • Size: 503.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metaobjects-0.12.1.tar.gz
Algorithm Hash digest
SHA256 16506681cacc1a601ef2e0a4ea194284ef85f1b1f12de22fb07eeaa8c824ca6d
MD5 695b4c9e2234face2f179567d59137f0
BLAKE2b-256 30cf7739b0c7fbb2b9124e5639c9059fc48201b0767dd80ead1b9de5a90b134e

See more details on using hashes here.

File details

Details for the file metaobjects-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: metaobjects-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 362.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metaobjects-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ad4431288b1cd8d3c0dab4607def793c451d54977e2493cf876e7dc1747adca
MD5 6dc85954863fff87d093046ae1593f2d
BLAKE2b-256 32a01302932d38b43e7c887ca1f9f9cba0f9b845aeae5ea7d86e55799ed3e57a

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