Skip to main content

BPMN Tools

a collection of tools to work with BPMN

Latest Version on PyPI Supported Implementations Built with PyPi Template

Installation

% pip install bpmn-tools

See it in Action

>>> import xmltodict
>>> from bpmn_tools.flow          import Process, Start, End, Task, Flow
>>> from bpmn_tools.collaboration import Collaboration, Participant
>>> from bpmn_tools.notation      import Definitions
>>> from bpmn_tools.diagrams      import Diagram, Plane, Shape, Edge
>>> from bpmn_tools.layout        import simple
>>> activities = [
...   Start(id="start"),
...   Task('Say "Hello!"', id="hello"),
...   Task('Wait for response...', id="wait"),
...   End(id="end")
... ]
>>> process = Process(id="process").extend(activities).extend([
...   Flow(source=activities[0], target=activities[1]),
...   Flow(source=activities[1], target=activities[2]),
...   Flow(source=activities[2], target=activities[3])
... ])
>>> collaboration = Collaboration(id="collaboration").append(
...   Participant("lane", process, id="participant")
... )
>>> model = Definitions(id="definitions").extend([
...   process,
...   collaboration,
... ])
>>> model.append(
...   Diagram(
...     id="diagram",
...     plane=Plane(id="plane", element=collaboration)
...   )
... )
Definitions({'id': 'definitions', 'xmlns:bpmn': 'http://www.omg.org/spec/BPMN/20100524/MODEL', 'xmlns:bpmndi': 'http://www.omg.org/spec/BPMN/20100524/DI', 'xmlns:dc': 'http://www.omg.org/spec/DD/20100524/DC', 'xmlns:di': 'http://www.omg.org/spec/DD/20100524/DI'})
>>> simple.layout(model)
>>> xml = xmltodict.unparse(model.as_dict(with_tag=True), pretty=True)
>>> with open("hello.bpmn", "w") as fp:
...   fp.write(xml)
... 
2937

Use bpmn-to-image to visualize the generated XML, because "what (sane) human being wants to read XML?" 😉

% npm install -g bpmn-to-image
% bpmn-to-image hello.bpmn:hello.png

Et voila...

Hello BPMN

Download files

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

Source Distribution

bpmn-tools-0.4.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

bpmn_tools-0.4.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file bpmn-tools-0.4.0.tar.gz.

File metadata

  • Download URL: bpmn-tools-0.4.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for bpmn-tools-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0f18b7720b2170f657c92f80d99fa696658a5e5ea904fd457078db9dec2cd03c
MD5 f310a4f5d2508006c1458108e272a1dc
BLAKE2b-256 11cce67dcb7e9616b2466d67d42a0f38206b2556ecb60cbc5612560c6bd4dd9c

See more details on using hashes here.

File details

Details for the file bpmn_tools-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: bpmn_tools-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for bpmn_tools-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 929ed28d15811a322a5d780038a68b4987ac23cbe94068ced9e8c4a8134be8e5
MD5 c20b45a7533c740ff9c8270e24450670
BLAKE2b-256 d5cdb8e1a86565ae05a704072b3b6539485ebc802341579d88ef04c240c1d085

See more details on using hashes here.

Supported by

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