Skip to main content

bpmn-lib

A Python library for navigating BPMN (Business Process Model and Notation) element hierarchies and managing in-memory process data. Designed for use in Python-based process automation and tooling pipelines.

What it does

bpmn-lib lets you load a BPMN process model from markdown-defined schemas and data files, then navigate it programmatically:

  • Traverse parent-child element hierarchies (e.g. bpmn_element → activity → task → user_task)
  • Navigate sequence flows forward and backward
  • Query element attributes across inheritance chains
  • Resolve data associations (inputs/outputs)
  • Validate element type specificity and FK constraints

Installation

pip install bpmn-lib

Install with dev dependencies (for development):

pip install -e ".[dev]"

Quick Start

from bpmn_lib.navigator.navigator_factory import create_navigator

navigator = create_navigator(
    schema_file="path/to/schema.md",
    data_file="path/to/data.md",
    hierarchy_file="path/to/hierarchy.md",
    log_dir="path/to/logs",
    schema_name="My BPMN Schema"
)

# Navigate sequence flows
next_elements = navigator.next_elements_in_flow(element_id)

# Get all elements in a process
elements = navigator.get_process_elements(process_id)

# Read an attribute (traverses inheritance chain)
value = navigator.get_element_attribute(element_id, "attribute_name")

Architecture

┌─────────────────────────────────────┐
│         Navigation Layer            │  ← BPMNHierarchyNavigator
├─────────────────────────────────────┤
│     Database Instance Layer         │  ← DatabaseInstance, DatabaseBuilder
├─────────────────────────────────────┤
│       Database Schema Layer         │  ← DatabaseSchema, TableDefinition
├─────────────────────────────────────┤
│          Parsing Layer              │  ← DatabaseSchemaParser, MarkdownDocument
└─────────────────────────────────────┘

Schema definitions and instance data are loaded from markdown files. The factory function orchestrates the full pipeline: parse schema → load data → validate constraints → build indexes → create navigator.

Testing

pytest tests/ -v
pytest tests/unit/ -v
pytest tests/integration/ -v
pytest tests/ --cov=bpmn_lib --cov-report=term-missing

License

MIT — see LICENSE

Metadata

Release files for bpmn-lib 4.0.7

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

Source distribution (sdist)

Source distribution for bpmn-lib 4.0.7
File Size Uploaded
bpmn_lib-4.0.7.tar.gz 56.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bpmn-lib 4.0.7
File Interpreter ABI Platform
bpmn_lib-4.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 122.4 kB

Release files / bpmn_lib-4.0.7.tar.gz

Download URL bpmn_lib-4.0.7.tar.gz
Size 56.1 kB
Tags Source
SHA-256 checksum
How to use checksums
df4b4a5ac3699312772495e6a1cf067d9c5606e3b4ad7f2cb1a6846697476403
BLAKE2b-256 checksum
How to use checksums
cde595d6d169714fdee300130898832e8182499740c18a365615178814b7fa6b
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 Aug 2, 2026.

Transparency log

Release files / bpmn_lib-4.0.7-py3-none-any.whl

Download URL bpmn_lib-4.0.7-py3-none-any.whl
Size 66.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b0c8a857a8578738cb9528977a2c59c8a51ab817c787ccf2cea2a9a222c3fe4
BLAKE2b-256 checksum
How to use checksums
4c850cfe317f1a63c2c273c62cbcb2f065e7feb6cb5692078b02b9482cb4d8b8
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 Aug 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.0.7 This release

2 release files

4.0.5

2 release 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