Skip to main content

ehubX

CI Documentation Status License Python PyPI version

ehubX is a Python framework for optimization-based energy system modeling developed by the Urban Energy Systems Laboratory at Empa. It has been applied in numerous large-scale energy system analyses for both scientific research and municipal planning projects.

Energy system models are defined through a combination of YAML configuration files and CSV input data. ehubX translates these inputs into Mixed-Integer Linear Programming (MILP) models that can be solved using a variety of external optimization solvers.

Its modular architecture supports a wide range of modeling capabilities, including:

  • Energy imports, exports, demands, load shedding, and load shifting
  • Storage, conversion, solar, wind, and electromobility technologies
  • Energy network modeling and transfer
  • Multi-stage, multi-hub, and multi-objective optimization
  • Single- and multi-objective optimization with objectives such as costs, emissions, and self-sufficiency

Installation

ehubX can be installed either via a PyPI pipeline, or for local development.

PyPI installation

ehubX is available on PyPI and can simply be installed via the command

pip install ehubx
pip install ehubx==2.3.0  # Install a specific version

Local development installation

For local development, we recommend setting up ehubX in a dedicated Python virtual environment to avoid conflicts with other packages. The step-by-step guide below is formulated using conda but can be adapted for other package managers or a manual setup. Similarly, we use poetry for dependency management, which can be replaced with pip if preferred.

Since ehubX relies on external MILP solvers, additionally ensure that you have a compatible solver installed and properly configured in your environment (see Specify solver in the documentation).

Development installation

  1. Clone the ehubX repository.

  2. Create a new virtual environment:

    conda create -n ehubx python=PYTHON_VERSION
    

Make sure that the PYTHON_VERSION you choose is a compatible with the current version of ehubX (see pyproject.toml in the root directory).

  1. Activate the environment:

    conda activate ehubx
    
  2. Install poetry for dependency management:

    conda install -c conda-forge poetry
    
  3. Navigate to the cloned ehubX directory and install using poetry:

    cd PATH_TO_EHUBX_REPO
    poetry install
    
  4. Run any of the main scripts in the examples folder to verify the installation.

Documentation

The complete documentation is available at:

https://ehubx.readthedocs.io/

Examples

The examples directory contains demo projects that give an impression on how to work with ehubX models. The most academic example and a good place to start is the small_demo.

How to cite

TODO

License

Copyright (C) 2026 Urban Energy Systems Laboratory, Empa.

This project is licensed under the GNU General Public License v3.0 or later. See the LICENSE file for details.

Metadata

Release files for ehubx 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ehubx 2.3.1
File Size Uploaded Provenance Actions
ehubx-2.3.1.tar.gz 265.1 kB With provenance Details for ehubx-2.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ehubx 2.3.1
File Interpreter ABI Platform Actions
ehubx-2.3.1-py3-none-any.whl Python 3 none any Details for ehubx-2.3.1-py3-none-any.whl

Total release size: 605.9 kB

Release files / ehubx-2.3.1.tar.gz

Download URL ehubx-2.3.1.tar.gz
Size 265.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1ba4307f0fe2e9168a382e01d7cebd6353f61b3d9ec67e3f80a18779bb8c4bd8
BLAKE2b-256 checksum
How to use checksums
3a40a3e204c8d3314c7b8b348c1457c6791061d90814adfc414bf30aba9f67e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / ehubx-2.3.1-py3-none-any.whl

Download URL ehubx-2.3.1-py3-none-any.whl
Size 340.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c161dfbb49a5ebc2e70f05259e58b84134705f6a34c39b1e51227266cc1d79b9
BLAKE2b-256 checksum
How to use checksums
72d64f63dbe160e1740f43be7d57e67f21603e3042cddda0505c00e39e8fa821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Security for ehubx 2.3.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ehubx-2.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

2.3.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page