Metadata-Version: 2.4
Name: metaobjects
Version: 0.9.0
Summary: Cross-language metadata standard: declare typed entities once, generate idiomatic drift-checked code across languages — Python port.
Project-URL: Homepage, https://metaobjects.dev
Project-URL: Repository, https://github.com/metaobjectsdev/metaobjects
Project-URL: Documentation, https://github.com/metaobjectsdev/metaobjects/tree/main/docs
Project-URL: Issues, https://github.com/metaobjectsdev/metaobjects/issues
Author-email: Doug Mealing <doug@metaobjects.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: code-generation,codegen,cross-language,drift-detection,fastapi,metadata,orm,pydantic,schema,sqlalchemy
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pydantic>=2; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: integration
Requires-Dist: fastapi>=0.110; extra == 'integration'
Requires-Dist: httpx>=0.27; extra == 'integration'
Requires-Dist: pg8000>=1.31; extra == 'integration'
Description-Content-Type: text/markdown

# MetaObjects (Python)

The Python port of the [MetaObjects](https://metaobjects.dev) 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

```bash
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`):

```python
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](https://github.com/metaobjectsdev/metaobjects/blob/main/spec/decisions/ADR-0006-ai-first-yaml-authoring.md)).
  Desugared to canonical JSON at load time. A directory may mix both freely.

## Links

- Standard, docs, and the other four ports: <https://metaobjects.dev>
- Source & issues: <https://github.com/metaobjectsdev/metaobjects>
- Full docs: <https://github.com/metaobjectsdev/metaobjects/tree/main/docs>

## License

Apache-2.0. See [LICENSE](https://github.com/metaobjectsdev/metaobjects/blob/main/LICENSE).
