smhi2epw
Build complete-year EnergyPlus weather files (.epw) from Swedish weather data.
smhi2epw combines SMHI station observations and STRÅNG solar data, fills gaps,
and can use nearby stations or same-year ERA5 when needed. Each automatic run
writes a JSON receipt describing its sources and recovery steps.
Install
Python 3.11 or newer is required:
python -m pip install smhi2epw
Creating a weather file needs internet access to SMHI and may use Open-Meteo for ERA5 recovery. Reading an existing EPW works offline.
Use
smhi2epw 2023 gothenburg.epw --station 71420 --city Gothenburg
Or use the Python API:
from smhi2epw import EPWConfig, compile_epw
result = compile_epw(EPWConfig(
year=2023,
output_path="gothenburg.epw",
station_id=71420,
city="Gothenburg",
))
print(result.report.warnings)
Automatic recovery is the default. Use --weather-policy strict to stop when
required source data are missing. See the quick start
and CLI guide for options, and the
method limitations before using
reconstructed weather in calibration or event analysis.
Docs and examples
The online documentation covers the API, methods, and limitations. The notebook course covers EPW inspection, comparisons, heat waves, gap filling, solar components, batch runs, and EnergyPlus. To run the notebooks from a source checkout:
git clone https://github.com/SB-Chalmers/smhi2epw.git
cd smhi2epw
python -m pip install -e ".[tutorials]"
jupyter lab examples/
Completeness evidence
The archived EPSM runs covered jobs from 2017–2024. Their recorded results were:
| Run | Recovery policy | Completed |
|---|---|---|
| v1 | Temporal filling | 32 / 85 |
| v2 | Opt-in station donors | 124 / 128 |
| v3 | Assessed donors and ERA5 | 128 / 128 |
All 128 v3 files were rechecked for calendar, row, field, range, and dew-point validity. They all used some reconstruction; completeness does not establish local weather accuracy. The archived results predate the pvlib solar refactor. See the run summary and notebook 08 for details and limitations.
Related SMHI packages
Thanks to the maintainers of smhi-open-data,
smhi-weather,
smhi-pkg, and
ifk-smhi. These projects provide SMHI
API clients and forecast access; smhi2epw focuses on complete-year weather
files for EnergyPlus.
Development
python -m pip install -e ".[dev,docs,tutorials]"
pytest -m "not network and not energyplus"
ruff check src tests examples docs
python -m sphinx -W --keep-going -b html docs docs/_build/html
The CI workflow also checks minimum dependencies, installed wheels, notebooks, and required EnergyPlus cases. Live provider tests run separately on the weekly schedule.
License
Metadata
Release files for smhi2epw 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smhi2epw-1.1.1.tar.gz | 176.6 kB | With provenance | Details for smhi2epw-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smhi2epw-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for smhi2epw-1.1.1-py3-none-any.whl |
Total release size: 244.5 kB
Release files / smhi2epw-1.1.1.tar.gz
| Download URL | smhi2epw-1.1.1.tar.gz |
|---|---|
| Size | 176.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b368a49d2a0e88992dd7fdeea19cac035b2818ec863ecc9a93306111d309f90d
|
|
BLAKE2b-256 checksum How to use checksums |
f8b8ae2739f2d488aa362860f06ddd724edbf84fe3b620f6f80fd343683ce115
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Oct 6, 2026.
Transparency logRelease files / smhi2epw-1.1.1-py3-none-any.whl
| Download URL | smhi2epw-1.1.1-py3-none-any.whl |
|---|---|
| Size | 67.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b530fab9977c9d725c69c3c51e450513dc3ac469f3d274d41003caaa33dbc627
|
|
BLAKE2b-256 checksum How to use checksums |
28c691c58ef45d2969a857168416570ac0a580916817aace76a3c5ccffe11a69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Oct 6, 2026.
Transparency logSecurity for smhi2epw 1.1.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.
Attestation for smhi2epw-1.1.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 Oct 6, 2026.
Transparency logA 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.