Skip to main content

BPMN Process Navigation Library

Project description

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

Project details


Download files

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

Source Distribution

bpmn_lib-4.0.5.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

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

bpmn_lib-4.0.5-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file bpmn_lib-4.0.5.tar.gz.

File metadata

  • Download URL: bpmn_lib-4.0.5.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bpmn_lib-4.0.5.tar.gz
Algorithm Hash digest
SHA256 0c0428de2bc44d9f3c28177fa41e0855199d4efcbe6f5f18564b5eb785a9e728
MD5 4a923b815bc6769926756f035ba11951
BLAKE2b-256 d6c46d34aabeb27452ffa556d56414833ef8a6299de2e56631992d8cf1e3799d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bpmn_lib-4.0.5.tar.gz:

Publisher: publish.yml on hennig-ai/bpmn-lib

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

File details

Details for the file bpmn_lib-4.0.5-py3-none-any.whl.

File metadata

  • Download URL: bpmn_lib-4.0.5-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bpmn_lib-4.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3dedf9060f7ad33150114b4bf1f0a445be09b2d73493dcedb3d988b06046a9f7
MD5 2d4dc16ceafa08b86145926a8c56e711
BLAKE2b-256 48e4eff06d98286b11d5c3fd7cfba0b2166e5f5feff57f5c9440f2e68b2193b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bpmn_lib-4.0.5-py3-none-any.whl:

Publisher: publish.yml on hennig-ai/bpmn-lib

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page