Skip to content

LienBosmans/pystackt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyStack't (pystackt)

PyStack't (pystackt) is a Python package based on Stack't that supports data preparation for object-centric process mining.

📦 Installation

PyStack't is published on PyPi and can be installed using pip.

pip install pystackt

🔍 Viewing Data

PyStack't creates DuckDB database files. From DuckDB version 1.2.1 onwards, you can explore them using the UI extension. Below code will load the UI by navigating to http://localhost:4213 in your default browser.

import duckdb

with duckdb.connect("./stackt.duckdb") as quack:
    quack.sql("CALL start_ui()")
    input("Press Enter to close the connection...")

Alternatively, you can use a database manager. You can follow this DuckDB guide to download and install DBeaver for easy access.

📝 Examples

⛏️🐙 Extract object-centric event log from GitHub repo (get_github_log)

from pystackt import *

get_github_log(
    GITHUB_ACCESS_TOKEN="insert_your_github_access_token_here",
    repo_owner="LienBosmans",
    repo_name="stack-t",
    max_issues=None, # None returns all issues, can also be set to an integer to extract a limited data set
    quack_db="./stackt.duckdb",
    schema="main"
)

📈 Interactive data exploration (start_visualization_app)

from pystackt import *

prepare_graph_data( # only needed once
    quack_db="./stackt.duckdb",
    schema_in="main",
    schema_out="graph_data_prep"
)

start_visualization_app(
    quack_db="./stackt.duckdb",
    schema="graph_data_prep"
)

📤 Export to OCEL 2.0 (export_to_ocel2)

from pystackt import *

export_to_ocel2(
    quack_db="./stackt.duckdb",
    schema_in="main",
    schema_out="ocel2",
    sqlite_db="./ocel2_stackt.sqlite"
)

👉 Contributing to PyStack't

We welcome any improvements, big and small, as well as new functionality that supports data preparation for object-centric process mining! For more information, please read the Contributing Guide.

About

Data preparation for object-centric process mining

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages