Extend ESDL's with relevant key performance indicators.
Project description
KPI Calculator
Calculates cost, energy, and emission KPIs from ESDL energy system models. Takes an ESDL file, handles the parsing, unit conversions, and time series loading, and returns standardized results in a single function call.
Part of the OMOTES project (Nieuwe Warmte Nu Design Toolkit).
Where It Fits
The KPI calculator can be used as a standalone tool (via its Python API or command line), but within the OMOTES design toolkit it typically runs as part of a larger pipeline. The ESDL MapEditor is the interface where users draw energy systems, run computations, and view results. The KPI calculator is called by worker processes (e.g., the simulator-worker) to compute KPIs after a simulation or optimization run. Results are written back into the ESDL as DistributionKPI elements, which the MapEditor then renders as dashboards, colored maps, and tables.
MapEditor → Orchestrator → Worker (simulation/optimization)
↓
KPI Calculator (this package)
↓
ESDL with KPIs → MapEditor (visualization)
Quick Start
from kpicalculator import calculate_kpis
results = calculate_kpis(esdl_file="path/to/model.esdl")
print(f"Total CAPEX: {results['costs']['capex']['All']} EUR")
print(f"LCOE: {results['costs']['lcoe']} EUR/MWh")
What It Does
The package reads an ESDL energy system design and:
- Extracts cost data from ESDL
costInformationelements, converting between units (EUR/m, EUR/kW, EUR/MW, EUR/MWh, %, etc.) - Loads time series from the best available source — pandas DataFrames, InfluxDB profiles, or XML files. Without time series, energy values are returned as zero.
- Calculates KPIs across three categories:
- Cost: CAPEX, OPEX, NPV (30-year, 5% discount), LCOE
- Energy: Consumption, production, demand, efficiency
- Emissions: Total CO2e, emissions intensity per MWh
Cost results are broken down by asset category (Production, Transport, Storage, Conversion, Consumption, All). Energy and emission results are system-wide totals.
Installation
pip install kpi-calculator
For full usage instructions — all parameter variants, time series options, ESDL string loading, command-line interface, and results format — see the Getting Started guide.
Dependencies
- pyesdl ~=25.7
- pandas >= 2.2.2
- numpy >= 2.1.0
- pydantic >= 2.0.0
- influxdb >= 5.3.2
- coloredlogs ~=15.0.1
- xmltodict == 0.14.2
- urllib3 >= 2.6.3
- filelock >= 3.20.1
Development
git clone https://github.com/Project-OMOTES/kpi-calculator.git
cd kpi-calculator
pip install uv
uv sync --all-extras
uv run pytest unit_test/
See the developer documentation for architecture details, tooling, and contribution workflow.
Tests enforce a minimum coverage threshold (configured in pyproject.toml).
Releases
Published to PyPI automatically when a GitHub Release is created from a version tag.
Documentation
Full documentation is hosted on ReadTheDocs:
- Getting Started — installation, usage, and results format
- KPI Guide — interpreting calculation results
- Developer Documentation — architecture, setup, and contributing
License
GNU General Public License v3.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kpi_calculator-0.4.1.tar.gz.
File metadata
- Download URL: kpi_calculator-0.4.1.tar.gz
- Upload date:
- Size: 77.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
393e7d3e552af5f6d7531dc0c2258021d90c5ad9a5f07eba14654a6fe407f2ce
|
|
| MD5 |
dcc905e67d2b81570bb4fdbd6804d27b
|
|
| BLAKE2b-256 |
99da06a9d9f07d8349cf0a58c076cd85ba80f9f7641b4b4bde82ceb673c1bdd5
|
Provenance
The following attestation bundles were made for kpi_calculator-0.4.1.tar.gz:
Publisher:
ci.yml on Project-OMOTES/kpi-calculator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kpi_calculator-0.4.1.tar.gz -
Subject digest:
393e7d3e552af5f6d7531dc0c2258021d90c5ad9a5f07eba14654a6fe407f2ce - Sigstore transparency entry: 1262847318
- Sigstore integration time:
-
Permalink:
Project-OMOTES/kpi-calculator@a09afd0378e64f5bc3fe711911fc535595c275e1 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/Project-OMOTES
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a09afd0378e64f5bc3fe711911fc535595c275e1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kpi_calculator-0.4.1-py3-none-any.whl.
File metadata
- Download URL: kpi_calculator-0.4.1-py3-none-any.whl
- Upload date:
- Size: 88.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
999f49b396c34c2308249b87dc25c28f3635a19e5c7c202df50b692fe41f6ca4
|
|
| MD5 |
70a2581bc994ddfc563dd67b35dad52d
|
|
| BLAKE2b-256 |
3500905d422908e5c645c4221886f3a1813925123d9decd089a3dacf2847cd73
|
Provenance
The following attestation bundles were made for kpi_calculator-0.4.1-py3-none-any.whl:
Publisher:
ci.yml on Project-OMOTES/kpi-calculator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kpi_calculator-0.4.1-py3-none-any.whl -
Subject digest:
999f49b396c34c2308249b87dc25c28f3635a19e5c7c202df50b692fe41f6ca4 - Sigstore transparency entry: 1262847376
- Sigstore integration time:
-
Permalink:
Project-OMOTES/kpi-calculator@a09afd0378e64f5bc3fe711911fc535595c275e1 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/Project-OMOTES
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a09afd0378e64f5bc3fe711911fc535595c275e1 -
Trigger Event:
release
-
Statement type: