Metadata-Version: 2.4
Name: flowmine
Version: 1.2.1
Summary: Library that is intended to operate with various process mining tasks.
Author: FlowMine Contributors
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: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<3,>=1.26
Requires-Dist: pandas<3,>=2.2
Requires-Dist: pyarrow<22,>=16
Requires-Dist: dataclassy<2,>=1.0
Requires-Dist: loguru<1,>=0.7
Requires-Dist: tqdm<5,>=4.66
Requires-Dist: joblib<2,>=1.4
Requires-Dist: scikit-learn<2,>=1.5
Requires-Dist: scipy<2,>=1.13
Requires-Dist: dateparser<2,>=1.2
Requires-Dist: pandarallel<2,>=1.6
Requires-Dist: pandas-downcast<2,>=1.2
Requires-Dist: openpyxl<4,>=3.1
Requires-Dist: plotly<7,>=5.23
Requires-Dist: graphviz<1,>=0.20
Requires-Dist: pydotplus<3,>=2.0
Requires-Dist: grandalf<1,>=0.8
Requires-Dist: networkx<4,>=3.2
Requires-Dist: matplotlib<4,>=3.9
Requires-Dist: defusedxml<1,>=0.7
Provides-Extra: nlp
Requires-Dist: torch<3,>=2.2; extra == "nlp"
Requires-Dist: transformers<5,>=4.44; extra == "nlp"
Requires-Dist: bpemb<1,>=0.3; extra == "nlp"
Requires-Dist: pymorphy3<3,>=2.0; extra == "nlp"
Provides-Extra: embeddings
Requires-Dist: gensim<5,>=4.3; extra == "embeddings"
Requires-Dist: catboost<2,>=1.2; extra == "embeddings"
Provides-Extra: loggen
Requires-Dist: seaborn<1,>=0.13; extra == "loggen"
Requires-Dist: Faker<38,>=26; extra == "loggen"
Requires-Dist: translatepy<3,>=2.3; extra == "loggen"
Provides-Extra: full
Requires-Dist: torch<3,>=2.2; extra == "full"
Requires-Dist: transformers<5,>=4.44; extra == "full"
Requires-Dist: bpemb<1,>=0.3; extra == "full"
Requires-Dist: pymorphy3<3,>=2.0; extra == "full"
Requires-Dist: gensim<5,>=4.3; extra == "full"
Requires-Dist: catboost<2,>=1.2; extra == "full"
Requires-Dist: seaborn<1,>=0.13; extra == "full"
Requires-Dist: Faker<38,>=26; extra == "full"
Requires-Dist: translatepy<3,>=2.3; extra == "full"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: summary

# FlowMine — process mining for Python

FlowMine turns an event log (one row per activity: case id, activity, timestamp) into a
process map, performance metrics and **AutoInsights**: an automatic check of every
activity for bottlenecks, rework, loops, one-off incidents, growing durations and rare
steps, each with the time it costs and a money estimate at your hourly rate.

What sets it apart from general process-mining libraries:

- **AutoInsights with an effect estimate** — one explained finding per activity
  (`AutoInsights.findings()`), in Russian or English.
- **Russian-first data handling** — dd.mm.yyyy dates, cp1251 files, Russian log messages
  (switchable to English).
- **Simulation and ML helpers** — process simulation (`flowmine.imitation`), missing
  value imputation, NLP helpers for free-text columns (`flowmine[nlp]`).

For a web UI on top of this library, see
[FlowMine Studio](https://pypi.org/project/flowmine-studio/).

## Install

```bash
pip install flowmine              # core
pip install "flowmine[nlp]"       # + torch/transformers text features
pip install "flowmine[embeddings]"  # + graph-embedding loop detection (gensim, catboost)
pip install "flowmine[full]"      # everything
```

Graphviz drawing (`GraphvizPainter`) also needs the Graphviz executables on your PATH:
https://graphviz.org/download/

## Quick start

```python
import pandas as pd
from flowmine import DataHolder
from flowmine.autoinsights import AutoInsights
from flowmine.miners import HeuMiner

df = pd.DataFrame({
    "case":     ["c1", "c1", "c1", "c2", "c2", "c2", "c2", "c2"],
    "activity": ["Submit", "Check", "Approve", "Submit", "Check", "Request info", "Check", "Approve"],
    "start":    pd.to_datetime([
        "2026-03-01 09:00", "2026-03-01 09:30", "2026-03-01 11:00",
        "2026-03-02 10:00", "2026-03-02 10:20", "2026-03-02 12:00",
        "2026-03-03 09:00", "2026-03-03 10:00",
    ]),
})

holder = DataHolder(df, col_case="case", col_stage="activity", col_start_time="start")

miner = HeuMiner(holder)
miner.apply()                      # miner.graph: the discovered process model

insights = AutoInsights(holder, min_cost=50 / 60)   # cost of one minute of work
insights.apply()
for finding in insights.findings(lang="en"):
    print(finding["stage"], [r["title"] for r in finding["reasons"]], finding["financial_effect"])
print(insights.fin_effects_summary(lang="en", currency="USD"))
```

Data can also be a path: `.csv`, `.xlsx`, `.txt` or `.xes` / `.xes.gz`
(`flowmine.read_xes()` reads XES into a DataFrame).

## What's inside

| Module | Contents |
|---|---|
| `flowmine.baza` | `DataHolder` (log parsing, time formats, durations, success flags), `read_xes` |
| `flowmine.miners` | `SimpleMiner` (DFG), `HeuMiner`, `AlphaMiner`, `AlphaPlusMiner`, `InductiveMiner`, `ClusterMiner` |
| `flowmine.metrics` | activity, transition, trace, case and resource metrics |
| `flowmine.autoinsights` | `AutoInsights`: findings per activity, effect estimate, text summary |
| `flowmine.visual` | Graphviz and matplotlib painters, plotly charts (`ChartPainter`) |
| `flowmine.bpmn` | BPMN 2.0 import and export |
| `flowmine.imitation` | process simulation |
| `flowmine.ml`, `flowmine.nlp` | imputation; text classification and QA extraction (`[nlp]`) |

## Language

Log messages are in Russian by default. For English:

```bash
export FLOWMINE_LANG=en        # or: flowmine.set_language("en")
```

`AutoInsights.findings()` and `fin_effects_summary()` take `lang="ru"` / `lang="en"`.

## Changes

See [CHANGELOG.md](CHANGELOG.md).

## License

MIT. © FlowMine Contributors.
