Metadata-Version: 2.4
Name: scope-pm4py
Version: 0.1.0
Summary: PM4Py loaders for Scope OCPT and OCPN JSON exports
Author: Scope
Project-URL: Repository, https://github.com/
Project-URL: Issues, https://github.com/
Keywords: pm4py,process-mining,ocpt,ocpn,object-centric-process-mining
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pm4py>=2.7

# scope-pm4py

Small Python adapter package for loading Scope OCPT and OCPN JSON exports into
PM4Py runtime objects.

## Install locally

From this directory:

```bash
python -m pip install -e .
```

## Usage

```python
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:

```json
{
  "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:

```json
{
  "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:

```bash
python -m pip install build
python -m build
```

This creates:

```text
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:

```bash
python -m pip install twine
```

Validate the build artifacts:

```bash
python -m twine check dist/*
```

Upload to TestPyPI first:

```bash
python -m twine upload --repository testpypi dist/*
```

Install from TestPyPI in a clean environment:

```bash
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:

```bash
python -m twine upload dist/*
```

After publishing, users install it with:

```bash
python -m pip install scope-pm4py
```
