Morphir, in Python

Write domain models in Python, exchange Morphir IR and generate Python libraries. Use the same compiler through the Python API, CLI or Morphir extension.

Start with Python Explore the API

models.py compiles to Morphir IR
from __future__ import annotations

from dataclasses import dataclass


@dataclass(frozen=True)
class Pending:
    pass


@dataclass(frozen=True)
class Approved:
    amount: float


type Decision = Pending | Approved
  1. Python domain model
  2. Morphir IR
  3. Generated Python library

Work with Morphir IR

Read, write and migrate versioned models with the dependency-free Python library.

Compile through Python or the CLI

Compile and generate in memory with the typed API, or follow a complete CLI round trip.