Skip to content

Morphir tooling and bindings to support the Python language and ecosystem

License

Notifications You must be signed in to change notification settings

finos/morphir-python

FINOS - Incubating CI

Morphir Python

Python port of Morphir - a library of tools for building and working with functional domain models.

Morphir enables you to write business logic once and use it across multiple platforms, languages, and runtimes. It provides a strongly-typed intermediate representation (IR) that captures the semantics of your domain model.

Packages

This monorepo contains two packages:

Package Description PyPI
morphir Core library - IR models, types, and functional domain modeling primitives PyPI
morphir-tools CLI tools and extensions for working with Morphir PyPI

Installation

Library Only

If you just need the Morphir library for your Python project:

pip install morphir

Or with uv:

uv add morphir

With CLI Tools

For the full toolset including CLI commands:

pip install morphir-tools

Or with uv:

uv add morphir-tools

Quick Start

from morphir.ir import Type, Value

# Example usage will be added as the library develops

Requirements

  • Python 3.14+

Development Setup

This project uses mise for tool management and uv for Python package management.

Prerequisites

Install mise (if not already installed):

curl https://mise.run | sh

Setup

  1. Clone the repository:
git clone https://github.com/finos/morphir-python.git
cd morphir-python
  1. Install tools and dependencies:
mise install
uv sync --all-groups
  1. Run the checks:
mise run check

Available Tasks

Task Description
mise run lint Run ruff linter
mise run format Run ruff formatter
mise run typecheck Run mypy and pyright
mise run test Run pytest unit tests
mise run test-bdd Run behave BDD tests
mise run test-all Run all tests
mise run coverage Run tests with coverage
mise run check Run all checks
mise run build Build packages
mise run clean Clean build artifacts

Project Principles

This project follows functional programming principles:

  • Immutability: Data structures are immutable by default
  • Type Safety: Strict type annotations with mypy and pyright
  • Algebraic Data Types: Using @dataclass(frozen=True), Unions, and Protocols
  • Making Illegal States Unrepresentable: Domain modeling that prevents invalid states at compile time

Roadmap

  1. Core IR model implementation
  2. JSON serialization/deserialization
  3. Type checking and validation
  4. Code generation backends
  5. CLI tooling

Contributing

For any questions, bugs or feature requests please open an issue. For anything else please send an email to morphir@finos.org.

To submit a contribution:

  1. Fork it (https://github.com/finos/morphir-python/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Read our contribution guidelines and Community Code of Conduct
  4. Commit your changes (git commit -am 'Add some fooBar')
  5. Push to the branch (git push origin feature/fooBar)
  6. Create a new Pull Request

NOTE: Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or EasyCLA). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.

Need an ICLA? Unsure if you are covered under an existing CCLA? Email help@finos.org

Related Projects

License

Copyright 2026 FINOS

Distributed under the Apache License, Version 2.0.

SPDX-License-Identifier: Apache-2.0

About

Morphir tooling and bindings to support the Python language and ecosystem

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •