momapy
momapy is a library for working with molecular maps. It currently supports SBGN and CellDesigner maps. Its key feature is its definition of a map, that is formed of two entities: a model, that describes what concepts are represented, and a layout, that describes how these concepts are represented. This definition is borrowed from SBML and its extensions layout+render, that allow users to add a layout to an SBML model. momapy aims at extending this definition to SBGN and CellDesigner maps.
Features of momapy include the following:
- support for SBGN PD and AF maps (read/write SBGN-ML with annotations, rendering information, and notes) and CellDesigner (read/write, with annotations and notes)
- read-only support for SBML (model only, no layout)
- decomposition of a map object into:
- a model object;
- a layout object;
- a mapping from layout element objects to model element objects.
- map, model, layout and mapping objects comparison; fast object in set checking
- rendering of maps to images (SVG, PDF, JPEG, PNG, WebP), or onto a Skia canvas for live rendering (via the
skiarenderer) - support for styling and CSS like stylesheets (including effects such as shadows)
- automatic geometry and anchors (for arcs, shape borders)
- local positioning (e.g. right of shape, fit set of shapes)
- easy extension with new model and layout element types
Installation
momapy is available as a Python package and can be installed with pip as follows (Python >=3.10,<=3.14):
pip install momapy
Optional dependencies
momapy includes several optional dependencies for rendering maps with the skia or cairo backends:
skia
pip install momapy[skia]
This extra depends on skia-python (https://github.com/kyamagu/skia-python), which itself depends on the following system packages:
- opengl
- libegl
- fontconfig
cairo
pip install momapy[cairo]
This extra depends on pygobject (https://pygobject.gnome.org/guide/sysdeps.html), which itself depends on the following system packages:
- glib
- libffi
all
All optional dependencies can also be installed together:
pip install momapy[all]
Usage
Typical usage of momapy includes reading a map and exploring its model:
from momapy.io import read
map_ = read("my_map.sbgn").obj
for process in map_.model.processes:
print(process)
Or rendering its layout:
from momapy.io import read
from momapy.rendering import render_map
map_ = read("my_map.sbgn").obj
render_map(map_, "my_file.svg")
User manual demo
Online (no installation required)
Local
To run the user manual demo locally:
git clone https://github.com/adrienrougny/momapy.git
cd momapy
pip install . jupyter
jupyter notebook demos/user_manual/main.ipynb
The user manual demo includes additional files (utils.py, example data) in the demos/ directory that are only available in the repository.
Documentation
The documentation for momapy is available here.
Metadata
Release files for momapy 0.15.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| momapy-0.15.0.tar.gz | 2.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| momapy-0.15.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.5 MB
Release files / momapy-0.15.0.tar.gz
| Download URL | momapy-0.15.0.tar.gz |
|---|---|
| Size | 2.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad9d2af5cc7093e23c8cca903b2050d9dd2587d6f2aaed2af772edaf7bb2b48a
|
|
BLAKE2b-256 checksum How to use checksums |
3bfd338ae2a78e8368d248807c94b54967db3e1a18b967bc85b24eef22507c96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 2, 2026.
Transparency logRelease files / momapy-0.15.0-py3-none-any.whl
| Download URL | momapy-0.15.0-py3-none-any.whl |
|---|---|
| Size | 334.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2f6e2333840a6df04aabc54b7b1a8a61662f6e624d91b692188de82c7e2aa3d
|
|
BLAKE2b-256 checksum How to use checksums |
8eb25c8d56283a8a278bb95c9d4b61ae90f2a1e0abb469a76cdda518744f4f56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 2, 2026.
Transparency log