Skip to main content

momapy

PyPI Python License Binder Documentation

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 skia renderer)
  • 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)

Binder

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

momapy-0.13.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

momapy-0.13.0-py3-none-any.whl (327.0 kB view details)

Uploaded Python 3

File details

Details for the file momapy-0.13.0.tar.gz.

File metadata

  • Download URL: momapy-0.13.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for momapy-0.13.0.tar.gz
Algorithm Hash digest
SHA256 b2c7ef52e577a72adb47e230cd8be88f6cffa23aaa6335b97d2a17b7f85d5818
MD5 232fc43fbafce5f39f4deb83774a03a8
BLAKE2b-256 94936ddb952aacad6d1799b3d998ef9eb5bb69cf255766eed843a570fabe8978

See more details on using hashes here.

Provenance

The following attestation bundles were made for momapy-0.13.0.tar.gz:

Publisher: release.yml on adrienrougny/momapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file momapy-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: momapy-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 327.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for momapy-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34c54e65808037b6a7e65af1199f0b2bbb64343dff24cc85d53f322f5dadc7db
MD5 dbe803350041b40cc69e8e5cdfa164be
BLAKE2b-256 7a49f9384fb8edd2967eed1c6b58e79ca7b443cc03455e6436cae3ab26971904

See more details on using hashes here.

Provenance

The following attestation bundles were made for momapy-0.13.0-py3-none-any.whl:

Publisher: release.yml on adrienrougny/momapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.14.0

2 files

This release

0.13.0 This release

2 files

0.12.0

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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