mergeway-python is a Python automation layer for Mergeway repositories. The
published PyPI package is mergeway. It
wraps mergeway-cli, uses the CLI's JSON output as its data boundary, and can
generate typed Python models from a repository's mergeway.yaml schema.
For the broader Mergeway toolset, see the main website:
https://mergewayhq.github.io/
- provide a Python-first API for Mergeway repository automation
- keep
mergeway-clias the source of truth for reads, writes, and validation - generate typed dataclasses from Mergeway entity definitions
- expose repository operations without introducing a custom persistence layer
mergeway-python requires mergeway-cli to be available on PATH.
Install the package into your Python environment:
pip install mergewayIf you are working from a local checkout and want an editable install:
pip install -e .If mergeway-cli is not already available in your environment, install it by
following the official installation guide:
https://mergewayhq.github.io/cli/getting-started/installation/
This example assumes you already have a Mergeway repository on disk:
from pathlib import Path
from mergeway import Database
repo_root = Path("/path/to/mergeway-repo")
db = Database(repo_root / "mergeway.yaml")
db.generate_classes(repo_root / "generated_models.py")
user = db.get("User", "user-alice")
posts = db.export("Post")
print(user.to_payload())
print([post.title for post in posts])Please see CONTRIBUTING.md