# csv-pm-llm-parsing
LLM-based CSV parsing for Process Mining purposes. It is compatible with advanced LLMs exposing the OpenAI’s API.
## How to install
pip install -U csv_pm_llm_parsing
## How to set up the LLM connection
Please provide the openai_api_url, openai_api_key, and openai_model as in the examples below.
Alternatively, they could be set up in the system environment variables OPENAI_API_URL, OPENAI_API_KEY, and OPENAI_MODEL.
Examples settings: * OpenAI’s GPT-4O: openai_api_url=’https://api.openai.com/v1’, openai_api_key=’sk’, openai_model=’gpt-4o’ * Locally run (small) LLM (https://ollama.com/library/qwen2:72b-instruct-q6_K): openai_api_url=’http://127.0.0.1:11434/v1, openai_api_key=’sk’, openai_model=’qwen2:72b-instruct-q6_K’ * DeepInfra (Qwen/Qwen2-72B-Instruct): openai_api_url=’https://api.deepinfra.com/v1/openai/’, openai_api_key=’adssad’, openai_model=’Qwen/Qwen2-72B-Instruct’
## Modules
### Separator and Quotechar detection (using LLMs)
Example code:
import csv_pm_llm_parsing
csv_path = “testfiles/sep_detection/01_comma_doublequote.csv” format = csv_pm_llm_parsing.detect_sep_and_quote(csv_path, input_encoding=”utf-8”, openai_api_url=”https://api.openai.com/v1”, openai_api_key=”sk-”, openai_model=”gpt-4o”, return_detected_sep=True) print(format)
### Case ID, Activity, and Timestamp columns detection (using LLMs)
Example code:
import pandas as pd import csv_pm_llm_parsing
csv_path = “testfiles/cid_acti_timest/01.csv” dataframe = pd.read_csv(csv_path) main_columns = csv_pm_llm_parsing.detect_caseid_activity_timestamp(dataframe, openai_api_url=”https://api.openai.com/v1”, openai_api_key=”sk-”, openai_model=”gpt-4o”, return_suggestions=True) print(main_columns)
### Timestamp Format detection (using LLMs)
Example code:
import pandas as pd import csv_pm_llm_parsing
csv_path = “testfiles/timest_format/05_rfc1123.csv” dataframe = pd.read_csv(csv_path) timest_column = “time:timestamp” timest_format = csv_pm_llm_parsing.detect_timest_format(dataframe, timest_column=timest_column, openai_api_url=”https://api.openai.com/v1”, openai_api_key=”sk-”, openai_model=”gpt-4o”, return_timest_format=True) print(timest_format) dataframe[timest_column] = pd.to_datetime(dataframe[timest_column], format=timest_format) dataframe.info()
## OVERALL CSV PARSING (executes all the modules)
Example code:
import csv_pm_llm_parsing
csv_path = “testfiles/overall/01.csv” dataframe = csv_pm_llm_parsing.full_parse_csv_for_pm(csv_path, openai_api_url=”https://api.openai.com/v1”, openai_api_key=”sk-”, openai_model=”gpt-4o”) dataframe.info() print(dataframe)
Metadata
Release files for csv-pm-llm-parsing 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| csv_pm_llm_parsing-0.1.tar.gz | 11.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csv_pm_llm_parsing-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / csv_pm_llm_parsing-0.1.tar.gz
| Download URL | csv_pm_llm_parsing-0.1.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3da64809bccd8a619b44089a8923bf9a3589926add01cbd7fb92a0a9a47bc646
|
|
BLAKE2b-256 checksum How to use checksums |
2a3dfe434196ab90717b0622a5eb913d0624cc44205c2988db65362a5043d505
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / csv_pm_llm_parsing-0.1-py3-none-any.whl
| Download URL | csv_pm_llm_parsing-0.1-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab748c6efbe88a3da0a59dbabfb3f3179c1849ec2d80d16e5a16e9c8748b1f17
|
|
BLAKE2b-256 checksum How to use checksums |
6f6c5b269749d756afd69bf8b67ae66d884f867d89f9aac58341795170084fb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for csv-pm-llm-parsing 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.