Processpiper. An open source python library to generate business process diagram using code.
Project description
ProcessPiper (Business Process Diagram as Code)
A python library to generate business process diagram using code.
Why ProcessPiper?
- Generate professional business process diagrams with Python code, eliminating the need for manual drawing and complex tools.
- Improve teamwork by utilising source code repositories for change monitoring, collaboration, and diagram history.
- Enhance precision by generating diagrams with code, sharing/exporting them in PNG format, and integrating them with Python tools.
Features
- Generate business process diagrams with Python code
- Alternatively business process diagram can be generated by using plain text
- Business process diagrams contains
- Diagram title
- Pool(s)
- Lane(s)
- Elements:
- Event: Start, End, Timer, Intermediate
- Activity: Task, Subprocess
- Gateway: Inclusive, Exclusive, Parallel
- Support for different colour themes
- Default
- GREYWOOF
- BLUEMOUNTAIN
- ORANGEPEEL
- GREENTURTLE
- Save diagram as PNG file
Installation
Install from PyPI
pip install processpiper
Python version requirements:
- Python 3.10, 3.11
Library Dependencies
- Pillow 9.4.0
Supported Platforms
- Windows
- Ubuntu
- MacOS
Documentation
Please refer to Processpiper Wiki for more information on how to use this RaC library.
Examples
(Method 1) Generate diagram using plain text
This is a sample code to generate a business process diagram using plain text.
from processpiper.text2diagram import render
input_syntax = """
title: Sample Test Process
lane: End User
(start) as start
[Enter Keyword] as enter_keyword
(end) as end
pool: System Search
lane: Database System
[Login] as login
[Search Records] as search_records
<Result Found?> as result_found
[Display Result] as display_result
[Logout] as logout
lane: Log System
[Log Error] as log_error
start->login->enter_keyword->search_records->result_found->display_result->logout->end
result_found->log_error->display_result
footer: Generated by ProcessPiper
"""
render(input_syntax, "my_process_map.png")
(Method 2) Generate diagram using Python code
This is a sample code to generate a business process diagram using Python code. The code is self-explanatory. The diagram is generated using the default colour theme.
```python
from processpiper import ProcessMap, EventType, ActivityType, GatewayType
with ProcessMap(
"Sample Test Process", colour_theme="BLUEMOUNTAIN") as my_process_map:
with my_process_map.add_lane("End User") as lane1:
start = lane1.add_element("Start", EventType.START)
enter_keyword = lane1.add_element("Enter Keyword", ActivityType.TASK)
with my_process_map.add_pool("System Search") as pool1:
with pool1.add_lane("Database System") as lane2:
login = lane2.add_element("Login", ActivityType.TASK)
search_records = lane2.add_element("Search Records", ActivityType.TASK)
result_found = lane2.add_element("Result Found?", GatewayType.EXCLUSIVE)
display_result = lane2.add_element("Display Result", ActivityType.TASK)
logout = lane2.add_element("Logout", ActivityType.TASK)
end = lane2.add_element("End", EventType.END)
with pool1.add_lane("Log System") as lane3:
log_error = lane3.add_element("Log Error", ActivityType.TASK)
start.connect(login, "User \nAuthenticates").connect(
enter_keyword, "Authenticated"
).connect(search_records, "Search Criteria")
search_records.connect(result_found, "Result").connect(display_result, "Yes")
display_result.connect(logout).connect(end)
result_found.connect(log_error, "No").connect(display_result)
my_process_map.set_footer("Generated by ProcessPiper")
my_process_map.draw()
my_process_map.save("my_process_map.png")
The generated diagram is as follows:
Development Status
First version 0.1.0 is released. This release would only cover the following basic business process elements. Other element types will be introduced in subsequence releases.
- Event: Start, End, Timer, Intermediate
- Activity: Task, Subprocess
- Gateway: Inclusive, Exclusive, Parallel
Any ideas or suggestions, please send it to me via GitHub Discussions.
Thank you for checking out my project. If you have found ProcessPiper useful and would like to show your appreciation, consider buying me a coffee or flat white :coffee: and keep me going. To buy me a coffee, simply follow this link:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for processpiper-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 044cd9dcd4bbebb9e989d0c3d7a71f37288742402894f5b5728743518a459bda |
|
MD5 | 9fb0a303f7a6cdc0ee8f2c77b03842d4 |
|
BLAKE2b-256 | b46fa5c8ee0e96c4392a70f7e02905b29325c79a4929f46063d986c054527ea4 |