This repository contains a Flask-based web API for converting and transforming process models.
- "/v2/health" Route - Current connection test/health endpoint
- "/v2/generate/bpmn" and "/v2/generate/pnml" Routes - Current versioned generation API
- "/v2/models" Route - Lists the available provider/model pairs (proxied from the connector)
- "/test_connection", "/generate_bpmn", "/generate_BPMN", "/generate_pnml" and "/generate_PNML" Routes - Functional deprecated compatibility endpoints until 2026-12-01
- "///echo" Route - Operational liveness endpoint
- "/metrics" Route - Prometheus metrics endpoint
- "/swagger" Route - Interactive Swagger UI rendered from the OpenAPI spec
- "/api/swagger.yaml" Route - Swagger/OpenAPI specification
- "/api_call" Route - Removed endpoint after its 2025-12-31 sunset date
Install WSL as instructed here: https://learn.microsoft.com/en-us/windows/wsl/install - The recommended Distro is Ubuntu 22.04
Install Docker as instructed here: https://docs.docker.com/desktop/wsl/
After cloning this repository, it's essential to set up git hooks to ensure project standards.
To set up the local environment without docker, use these commands:
- Create and activate the local environment:
From project root folder use:
# Windows python -m venv .venv .\.venv\Scripts\activate # Mac/Linux python -m venv .venv source .venv/bin/activate
- Install the requirements:
pip install -r requirements/dev.txt
- Run the Flask app locally:
(
flask --app flasky run
.flaskenvalready setsFLASK_APP=flasky.py, so a bareflask runworks too.)
To run the project as docker image, use the project root directory (where the Dockerfile is located) and run the following commands:
Build the container (usually needed only once):
docker build -t t2p-api .Run the app:
docker run -p 4000:5000 t2p-apiBefore you start testing the endpoint, make sure the app is running. If you are not sure how to run the app, please refer to the previous section
Open Postman and send a GET request to the following URL:
http://localhost:4000/v2/healthOpen a terminal and send a GET request to the following URL:
curl http://localhost:4000/v2/healthThe service version is stored in the root-level version.py file under the __version__ attribute. This value is used for container tagging in CI.
First install the requirements, see section "Setting Up Your Local Environment" for more information.
To run all the tests, use the following command:
pytest -vTo see the coverage report, use the following command:
pytest --cov=app --cov-report=term-missing -vIf you want to see the coverage report in html format, use the following command:
coverage htmlThen navigate to the htmlcov directory and open the index.html file in a browser.