Skip to main content

Morphir Python

Read the documentation site for installation, API examples and CLI workflows.

CLI tools and extensions for Morphir Python.

This package provides:

  • Command-line interface for Morphir operations
  • Code generation backends
  • File I/O utilities
  • Development tools

Installation

For an isolated CLI installation managed by mise, use one of the verified mise/uv or mise/pipx configurations. mise manages Python 3.14 and installs the compiled native dependency from a wheel. No Rust toolchain is required on supported platforms.

To install the CLI and compiler API into an existing Python environment:

python -m pip install --only-binary=:all: morphir-python==0.1.2

Or with uv:

uv add morphir-python

The morphir-python distribution contains the CLI and depends on the separate morphir library/SDK distribution. Python imports remain morphir and morphir_tools. Version 0.0.1 was a bundle; for migration to CLI-only 0.0.2, see the repository installation guide.

Usage

The morphir-python command inspects and converts versioned morphir-ir.json files. It reads format 3.0.x (what morphir-elm writes), format 3.1.x (which adds the v3 Specs distribution) and draft IR 4.0.x, reads the legacy formats 1 and 2 to upgrade them, and uses the morphir library for every read, write, and migration.

morphir-python ir inspect morphir-ir.json
morphir-python ir convert morphir-ir.json --to v4 -o out.json --package-version 1.2.0
morphir-python ir convert v4.json --to v3 -o out.json --drop-source-locations
morphir-python ir convert old-format-1.json --to v3 -o out.json
morphir-python ir convert morphir-ir.json --to v4 --v4-spelling expanded -o out.json

inspect prints the normalized format version, the distribution kind (Library, Specs or Application), and the package name, and labels v4 as draft and formats 1 and 2 as legacy. convert handles Library and Specs in both directions. It writes a v3 Library as format 3 and a v3 Specs as "3.1.0", the lowest version that holds each. A legacy format 1 or 2 file converts to a format 3.0.0 Library or draft v4; nothing writes format 1 or 2. Draft v4 is written in the compact canonical spelling, as other Morphir tools write it; --v4-spelling expanded writes every node in the expanded form instead. Both spellings read back to the same model. convert writes through a temporary file and renames it only on success, so a failed conversion leaves no output file. Diagnostics go to standard error as code at location: message.

Exit codes are 0 for success (also with warnings), 1 for a diagnostic, and 2 for a usage error. 3.x releases from 3.2.0 on are rejected; see the morphir package README for the format-version rules and the draft v4 status.

Requirements

  • Python 3.14+
  • morphir>=0.1.0 and morphir-python-native==0.1.2 (installed as dependencies)

License

Apache-2.0 - see the LICENSE file for details.

Metadata

Release files for morphir-python 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for morphir-python 0.1.2
File Size Uploaded Provenance Actions
morphir_python-0.1.2.tar.gz 17.1 kB With provenance Details for morphir_python-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for morphir-python 0.1.2
File Interpreter ABI Platform Actions
morphir_python-0.1.2-py3-none-any.whl Python 3 none any Details for morphir_python-0.1.2-py3-none-any.whl

Total release size: 38.0 kB

Release files / morphir_python-0.1.2.tar.gz

Download URL morphir_python-0.1.2.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1175cfb9ed5e76fb221d9cb33259ab8ba2bc52eba934b7d15865433a9b477643
BLAKE2b-256 checksum
How to use checksums
7d9cce89264f3d4f95e1d451d6704bb460db0cb356640783586562b6d3200b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / morphir_python-0.1.2-py3-none-any.whl

Download URL morphir_python-0.1.2-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c6e3147e790c9fa5775fb80a5ca4a10f2b385979b4362b48175963bcceb9dd5
BLAKE2b-256 checksum
How to use checksums
13d6a4318266fe3fa0618bd7c70e140f7b1c638e604d0f8d4fc54b807f9591f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for morphir-python 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for morphir_python-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page