Library for input/output of transition systems in a unified Markov binary (UMB) format.
Project description
umbi
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 ExplicitAts object, modify initial states, and write it back:
import umbi
ats = umbi.ats.read("in.umb")
ats.set_initial_states([ats.num_states - 1])
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.
ExplicitAts - format-agnostic abstraction for annotated transition systems (states, transitions, annotations). Recommended for most use cases: easiest to use programmatically and remains stable across UMB format changes.
CLI
umbi provides a basic CLI for umbfile manipulation.
Options:
--import-umb <path>- import umbfile asExplicitUmb--import-ats <path>- import umbfile asExplicitAts--export <path>- export to umbfile (requires--import-umbor--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
Dependencies are pinned in the uv.lock lockfile for reproducible builds. New versions are published to PyPI via the release workflow. The workflow is triggered automatically when:
- a new version tag is pushed (format:
v*.*.*) - the bump version workflow completes successfully (can be run manually via GitHub actions)
The release workflow:
- updates the uv.lock lockfile to reflect any dependency changes
- builds the distribution packages
- publishes to PyPI via trusted publishing
- updates the stable branch pointer to track the latest release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file umbi-0.2.5.tar.gz.
File metadata
- Download URL: umbi-0.2.5.tar.gz
- Upload date:
- Size: 53.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c522a33d3032a2f34186a7b8a7276ed1821bb538fcbd5524be13cffddafb9372
|
|
| MD5 |
9cd20c28c788d48b5d1f5265508e47a6
|
|
| BLAKE2b-256 |
5659b7a2d3b40114beebd3ebc8d6fba197674e79a8575e4271c47064bb583e8b
|
Provenance
The following attestation bundles were made for umbi-0.2.5.tar.gz:
Publisher:
release.yml on pmc-tools/umbi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
umbi-0.2.5.tar.gz -
Subject digest:
c522a33d3032a2f34186a7b8a7276ed1821bb538fcbd5524be13cffddafb9372 - Sigstore transparency entry: 1181089503
- Sigstore integration time:
-
Permalink:
pmc-tools/umbi@67ec4f2fbeac700667fd4c5705f394871f2d95ae -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pmc-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67ec4f2fbeac700667fd4c5705f394871f2d95ae -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file umbi-0.2.5-py3-none-any.whl.
File metadata
- Download URL: umbi-0.2.5-py3-none-any.whl
- Upload date:
- Size: 66.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aa36dd00d4d40ff19934f618e84dcf4b708b29decf6d4942ecc882d9635ccd9
|
|
| MD5 |
01c92d438cf68b5125846ab00122d39d
|
|
| BLAKE2b-256 |
b62f3f680be3f6beeb7dd5fb774c8fda6a77118b94d79d8c739f2618036aee67
|
Provenance
The following attestation bundles were made for umbi-0.2.5-py3-none-any.whl:
Publisher:
release.yml on pmc-tools/umbi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
umbi-0.2.5-py3-none-any.whl -
Subject digest:
2aa36dd00d4d40ff19934f618e84dcf4b708b29decf6d4942ecc882d9635ccd9 - Sigstore transparency entry: 1181089519
- Sigstore integration time:
-
Permalink:
pmc-tools/umbi@67ec4f2fbeac700667fd4c5705f394871f2d95ae -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pmc-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67ec4f2fbeac700667fd4c5705f394871f2d95ae -
Trigger Event:
workflow_run
-
Statement type: