Skip to content

DemandCast

Global hourly electricity demand forecasting

A project developed by

OET Logo

Supported by

Breakthrough Energy Logo

About

DemandCast is a Python-based project focused on collecting, processing, and forecasting hourly electricity demand data. The aim of this project is to support energy planning studies by using machine learning models to generate hourly time series of future electricity demand or for countries without available data.

DemandCast models the gross electricity demand: the electricity consumed, whatever generation supplies it, including the part that rooftop solar and other generation embedded in the distribution networks supply. Energy system models can then represent that generation explicitly, without counting it twice. Where a data source leaves it out, DemandCast adds an estimate of it when one is published, and flags the series otherwise (see Data Retrieval).

Features

  • Retrieval of hourly and sub-hourly electricity demand data from public sources.
  • Retrieval of weather and socio-economic data.
  • Cleaning and quality flags of the electricity demand, and combination of the data sources of each country or subdivision into one hourly series.
  • Training and validation of machine learning models.
  • Forecasting using trained machine learning models.
  • Modular design for adding new countries or data sources.
  • Support for reproducible, containerized development.

Feature roadmap

The project is in active development and we are always looking for suggestions and contributions. Below is a non-exhaustive list of planned features:

  • Add support to forecast electricity demand in user-defined subnational regions.
  • Enhance model training by integrating new datasets:
    • New countries and subdivisions with available electricity demand data,
    • Sectoral electricity demand (agriculture, industry, transport, buildings),
    • Adoption of EVs, air conditioning, and heat pumps.
  • Add and test new machine learning models for forecasting (e.g., timesfm).
  • Improve validation by considering simultaneity of peaks between actual and forecast electricity demand.
  • Package the project for easier installation and usage.

Documentation

The documentation is currently hosted on GitHub pages connected to this repository. It is built with mkdocs.

To run it locally:

cd webpage
uv run mkdocs serve

Other online resources include:

Contributing

We welcome contributions in the form of:

  • Country-specific data retrieval modules
  • New or improved forecasting models
  • Documentation and testing enhancements

Please read the contributing guidelines before opening a pull request, and follow our Code of Conduct. Issues labelled good first issue are a good place to start.

We also would like to hear your feedback and suggestions. You can share your thoughts by completing this short survey.

How DemandCast works

DemandCast

The architecture page describes the scripts, the folders of the code and of the data, and how the modules depend on each other.

Data sources

The table below provides an overview of the data sources currently used in DemandCast for hourly and sub-hourly electricity demand, weather, and socio-economic data for both historical and future periods.

Data type Data sources for the historical period Data sources for the future period
Hourly and sub-hourly
electricity demand
Various public sources listed in the
Awesome Electricity Demand repository
--
Temperature ERA5 CMIP6
Gridded population SEDAC GPW v4 Wang X. et al. (2022)
National population World Bank IIASA SSP Database
Gridded GDP, PPP Wang T. et al. (2022) Wang T. et al. (2022)
National GDP per capita, PPP World Bank, IMF IIASA SSP Database
National annual electricity
demand per capita
Ember, completed by the World Bank scaled to Ember IIASA SSP Database

The current state page shows on a map the countries and subdivisions for which retrieval modules of electricity demand data are available in DemandCast, gives their numbers, shows their data by GDP and electricity demand per capita, and shows the forecast errors of the models.

You can find the code that we used to retrieve the data in their respective files inside the demandcast/retrievals folder.

The retrieved data is not redistributed, since the licences of many data sources do not allow it: DemandCast retrieves it from the sources, and the people who work on it share their data folders through a private bucket (see sharing and publishing). The trained model and its forecasts are published on Zenodo (see below).

Dataset of global forecasts

Forecasted hourly electricity demand for 184 countries from 2000 to 2024 is available in this Zenodo repository.

Forecasts for future years, including different climate models and scenarios, will be included in a future release. However, DemandCast is already capable of generating these forecasts for users who wish to produce them independently.

Getting started

The getting started guide installs DemandCast and goes from the retrieval of the data to a forecast. To change the code, add a data source or a model, see the contributing guidelines.

Citation

If you use DemandCast in your work, please cite the paper. GitHub's "Cite this repository" button, generated from CITATION.cff, provides the reference in other formats.

@inproceedings{steijn2025demandcast,
  title     = {DemandCast: Global hourly electricity demand forecasting},
  author    = {Steijn, Kevin and Goli, Vamsi Priya and Antonini, Enrico},
  booktitle = {NeurIPS 2025 Workshop: Tackling Climate Change with Machine Learning},
  year      = {2025},
  doi       = {10.48550/arXiv.2510.08000},
  url       = {https://arxiv.org/abs/2510.08000}
}

Maintainers

The project is maintained by the Open Energy Transition team. The team members currently involved in this project are:

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).