Skip to main content

umbi

Python 3.12+ License MIT PyPI Build Status

Library for input/output of annotated transition systems (ATSs) in a unified Markov binary (UMB) format. See the format specification for details.

Installation:

pip install umbi

Quick start

A short example where we read a umbfile into an SimpleAts object, modify initial states, and write it back:

import umbi
ats = umbi.ats.read("in.umb")
ats.initial_states = [ats.num_states - 1]
umbi.ats.write(ats, "out.umb")

Here is another example where we create a simple CTMC:

import umbi
from fractions import Fraction

ats = umbi.ats.SimpleAts()
ats.time = umbi.ats.TimeType.STOCHASTIC
ats.num_states = 3
ats.initial_states = [0]
ats.state_to_exit_rate = [3/2, Fraction(7,3), 1]
ats.new_choice(state=2, targets=[2], probs=[1])
ats.new_choice(state=1, targets=list(ats.states), target_prob=lambda s: Fraction(1,ats.num_states))
ats.new_choice(state=0, targets=[1,2], probs=[1/2, 1/2])
annotation = ats.new_ap_annotation("deadlock")
annotation.state_values = [False, False, True]

umbi.ats.write(ats, "out.umb")

More examples can be found in the examples folder.

API

umbi offers multiple levels of abstraction for working with UMB files:

TarFile and TarCoder - low-level access to umbfile contents.

ExplicitUmb - in-memory representation of a typical umbfile. Attributes are standard Python objects (lists, dicts, dataclasses) providing a deserialized view of the file contents.

SimpleAts - format-agnostic abstraction for annotated transition systems (states, transitions, annotations, etc.). Recommended for most use cases: easiest to use programmatically and remains stable across UMB format changes. See umbi.ats.examples for usage examples.

CLI

umbi provides a basic CLI for umbfile manipulation.

Options:

  • --import-umb <path> - import umbfile as ExplicitUmb
  • --import-ats <path> - import umbfile as SimpleAts
  • --export <path> - export to umbfile (requires --import-umb or --import-ats)
  • --log-level <LEVEL> - set logging level: DEBUG, INFO (default), WARNING, ERROR, CRITICAL

Example:

umbi --import-umb input.umb --export output.umb --log-level DEBUG

Development

(optional) create and activate a python environment:

python -m venv .venv
source .venv/bin/activate

Setup

Install development dependencies:

pip install .[dev]

Testing

Run the test suite with pytest:

python -m pytest              # run all tests
python -m pytest tests/tar/   # run specific test directory
python -m pytest -k test_name # run tests matching pattern

Current test coverage:

  • binary - serialization and binary data handling
  • datatypes - data type definitions and conversions
  • tar - tarfile I/O and utilities

Code Quality

Pre-commit hooks automatically run code quality checks before each commit. Configuration: .pre-commit-config.yaml

Set up the hooks with:

pre-commit install

Run hooks manually on all files:

pre-commit run --all-files

Individual tools can be run manually:

Ruff -- Code formatting and linting. Config: pyproject.toml ([tool.ruff])

ruff check .       # check for issues
ruff check . --fix # check and fix
ruff format .      # format code

Pyright -- Static type checking. Config: pyproject.toml ([tool.pyright])

pyright             # check entire project
pyright umbi/       # check specific directory

Release

To bump the version, run

bump-my-version bump <patch|minor|major>
git push origin --follow-tags

or run the bump version workflow (via GitHub Actions UI). When the new version tag is pushed, the release workflow is automatically triggered to:

  1. update uv.lock to pin dependencies
  2. build the distribution packages
  3. publish to PyPI via trusted publishing
  4. update the stable branch to track the latest release

Metadata

Release files for umbi 0.2.15

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

Source distribution (sdist)

Source distribution for umbi 0.2.15
File Size Uploaded Provenance Actions
umbi-0.2.15.tar.gz 64.4 kB With provenance Details for umbi-0.2.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for umbi 0.2.15
File Interpreter ABI Platform Actions
umbi-0.2.15-py3-none-any.whl Python 3 none any Details for umbi-0.2.15-py3-none-any.whl

Total release size: 145.6 kB

Release files / umbi-0.2.15.tar.gz

Download URL umbi-0.2.15.tar.gz
Size 64.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7c7334679c719a353b256b4cd5f77f9bb6119dae2e495f44a5773f99bf81b32b
BLAKE2b-256 checksum
How to use checksums
f6bdffef60e6fd1a6c4abc1b2f26f8a463c60aa087ce5436562a9017d9b86efc
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 27, 2026.

Transparency log

Release files / umbi-0.2.15-py3-none-any.whl

Download URL umbi-0.2.15-py3-none-any.whl
Size 81.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3d0fd3700b58996515f1ffb0c47e259f1b00c24d2a750ed508ce12a04325ee3
BLAKE2b-256 checksum
How to use checksums
8139ecf6815d9f06cbc94476f048577268253555f0fe4c01931a448e52e2287c
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 27, 2026.

Transparency log

Security for umbi 0.2.15

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for umbi-0.2.15.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 27, 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.

Release history Release notifications | RSS feed

This release

0.2.15 This release

2 release files Full provenance

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