Skip to main content

apm4py is a Python API for Appian Process Mining (APM)

Project description

apm4py

Python 3.7 apm4py Maintenance

apm4py is Python API for Appian Process Mining. It focuses on resource management, but provides methods that can be used to access the processed data as well.

This package is still in initial development state. Anything may change at any time. The public API should not be considered stable.

Installation

You can install apm4py directly from PyPi with e.g.

$ pip install apm4py

How to get started

To connect with an api at e.g. 'https://cloud-backend.lanalabs.com', first create an API with

from apm4py import create_api

api = create_api('https', 'cloud-backend.lanalabs.com', API_KEY)

Using the Command Line

Command line currently only supports uploading event logs. Four files for the event log have to be in one folder and follow the convention:

  • event log CSV has "event" in the file name
  • case attribute CSV has "case" in the file name
  • event log semantics json have "event" in the file name
  • case attribute log semantics json have "case" in the file name

See ./tests/data/incident_management as an example.

To install the CLI globally, use pipx:

pipx install apm4py
apm upload --name "Incident Management" tests/data/incident_management
apm list-logs

It will prompt you for host settings on the first run and also supports having multiple profiles with different hosts. Similar as the aws-cli. Profiles are saved in ~/.apm/.

If you want to run the command line client from source, you have to prepend poetry run before any apm command. For example poetry run apm list-logs.

Growing event logs

apm4py comes with a utility called log grower that allows to grow existing event logs by copying there content as many times as wanted. While copying the events and cases it makes sure to alter the CaseIDs so that new cases are created. Thereby, the structure of the event log is preserved. That is, the number of activities and the number of variants stay the same.

It expects an existing event log with four files in one folder as described above. In order to generate a 10 times larger event log from the incident management data set provided in the test data of this repository, you can run

apm grow-log ./tests/data/incident_management \
    --csv-separator ";" \
    --output-csv \
    --growth-factor 10

Building and installing from source

poetry install
poetry build
pip install /dist/apm4py-0.X.Y-py3-none-any.whl

How to contribute

See the details in CONTRIBUTING.md.

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apm4py-0.1.14.tar.gz (24.5 kB view hashes)

Uploaded Source

Built Distribution

apm4py-0.1.14-py3-none-any.whl (29.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page