PM4Py loaders for Scope OCPT and OCPN JSON exports
Project description
scope-pm4py
Small Python adapter package for loading Scope OCPT and OCPN JSON exports into PM4Py runtime objects.
Install locally
From this directory:
python -m pip install -e .
Usage
from scope_pm4py import load_ocpt, load_ocpn
import pm4py
tree = load_ocpt(r"C:\Users\Postb\Downloads\scope_ocpt_example_pm4py.json")
pm4py.view_process_tree(tree)
ocpn = load_ocpn(r"C:\Users\Postb\Downloads\scope_ocpn_example_pm4py.json")
pm4py.view_ocpn(ocpn, format="svg")
Expected JSON
The loader accepts files with a top-level payload object or files where the
payload is the top-level object.
OCPT exports should contain:
{
"schema": "scope.pm4py.ocpt",
"schema_version": "1.0.0",
"payload": {
"tree": {
"type": "operator",
"operator": "sequence",
"children": [
{ "type": "activity", "label": "Create Order" },
{ "type": "tau" }
]
}
}
}
OCPN exports should contain:
{
"schema": "scope.pm4py.ocpn",
"schema_version": "1.0.0",
"payload": {
"object_types": ["order"],
"activities": ["Create Order"],
"petri_nets": {
"order": {
"places": [
{ "id": "p1", "name": "source", "initial": true },
{ "id": "p2", "name": "sink", "final": true }
],
"transitions": [
{ "id": "t1", "name": "Create Order", "label": "Create Order" }
],
"arcs": [
{ "source": "p1", "target": "t1" },
{ "source": "t1", "target": "p2" }
]
}
}
}
}
The OCPN loader reconstructs PM4Py PetriNet and Marking objects. A plain
json.load() result is not enough for PM4Py visualization and analysis.
Build
From this directory:
python -m pip install build
python -m build
This creates:
dist/
scope_pm4py-0.1.0-py3-none-any.whl
scope_pm4py-0.1.0.tar.gz
Publish to PyPI
Create accounts on:
- TestPyPI: https://test.pypi.org/
- PyPI: https://pypi.org/
Create an API token in the account settings. Then install Twine:
python -m pip install twine
Validate the build artifacts:
python -m twine check dist/*
Upload to TestPyPI first:
python -m twine upload --repository testpypi dist/*
Install from TestPyPI in a clean environment:
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ scope-pm4py
If that works, upload to the real PyPI:
python -m twine upload dist/*
After publishing, users install it with:
python -m pip install scope-pm4py
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scope_pm4py-0.1.0.tar.gz.
File metadata
- Download URL: scope_pm4py-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f8f63a2c98fdcacf62508fdd070b16e452f1d51d306cf067044697321dea5d
|
|
| MD5 |
f525fd939ebd3a36dab1ff638e69ba84
|
|
| BLAKE2b-256 |
200a4a326975de6b251ee9ca7a783f2f0fdba286e070307d74b56d7161e0f0d9
|
File details
Details for the file scope_pm4py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scope_pm4py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2386649cc02cc2bb0a89d89ed1c8cb187c5b4001252d9473e35ae7b52d9869a3
|
|
| MD5 |
9e212452f942b2be8f8f30efb7ec4ffb
|
|
| BLAKE2b-256 |
452e7b790109bbc4cc60c13adf5a0ac1a5a9ce0d2d77a05a880d1321c03b7f08
|