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.

Download files

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

Source Distribution

ehubx-2.3.1.tar.gz (265.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ehubx-2.3.1-py3-none-any.whl (340.8 kB view details)

Uploaded Python 3

File details

Details for the file ehubx-2.3.1.tar.gz.

File metadata

  • Download URL: ehubx-2.3.1.tar.gz
  • Upload date:
  • Size: 265.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ehubx-2.3.1.tar.gz
Algorithm Hash digest
SHA256 1ba4307f0fe2e9168a382e01d7cebd6353f61b3d9ec67e3f80a18779bb8c4bd8
MD5 b3ae15b37bab913623c6b1be10781654
BLAKE2b-256 3a40a3e204c8d3314c7b8b348c1457c6791061d90814adfc414bf30aba9f67e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ehubx-2.3.1.tar.gz:

Publisher: ci.yml on uesl-empa/ehubx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ehubx-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: ehubx-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 340.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ehubx-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c161dfbb49a5ebc2e70f05259e58b84134705f6a34c39b1e51227266cc1d79b9
MD5 1ad7760956f5affa84c2e691b80b2669
BLAKE2b-256 72d64f63dbe160e1740f43be7d57e67f21603e3042cddda0505c00e39e8fa821

See more details on using hashes here.

Provenance

The following attestation bundles were made for ehubx-2.3.1-py3-none-any.whl:

Publisher: ci.yml on uesl-empa/ehubx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.3.1 This release

2 files

2.3.0

2 files

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