Skip to main content

epwforge

Python client for EPWForge — generate climate-stressed EPW weather files for any global location. Custom TMYx / AMY from ERA5, CMIP6 future-climate morphing, urban heat island, extreme-event injection, and wildfire smoke overlays. For EnergyPlus, OpenStudio, IES VE, eQUEST.

Install

pip install epwforge

Requires Python ≥ 3.9.

Usage

from epwforge import Client

c = Client(api_key="sk_live_...")   # or set EPWFORGE_API_KEY env var

# Basic TMYx for any global lat/lon
c.weather_file(lat=40.71, lon=-74.01, save_to="nyc.epw")

# Actual Meteorological Year (specific year of ERA5 reanalysis)
c.weather_file(lat=40.71, lon=-74.01, basis="amy", amy_year=2023,
               save_to="nyc_2023.epw")

# Future climate morphing — IPCC CMIP6 SSPs at 4 horizons × 7 percentiles
c.weather_file(lat=40.71, lon=-74.01, ssp="ssp245", year=2050,
               save_to="nyc_2050.epw")

# Worst-case design scenario — UHI + heat wave + smoke + compound events
c.weather_file(
    lat=33.45, lon=-112.07,
    ssp="ssp585", year=2090, percentile=90,
    uhi="urban",
    events="heatwave,hothumid",         # compound: humidity blends into heat
    intensity="heatwave:9",              # override AR6 auto-fill
    smoke=True, smoke_intensity=5,       # AOD ~3 (Bay Area 2020 levels)
    save_to="phoenix_worst.epw",
)

# Per-model CMIP6 ensemble — one EPW per model for inter-model uncertainty
c.ensemble(lat=47.6, lon=-122.3, ssp="ssp245", year=2050,
           save_to_dir="seattle/")

# ASHRAE design-day (DDY) file for EnergyPlus sizing
c.design_day(lat=40.71, lon=-74.01, ssp="ssp585", year=2090,
             save_to="nyc_2090.ddy")

# Nearest ERA5 grid cells to a coordinate
c.stations(lat=40.71, lon=-74.01, max_results=5)

save_to (or save_to_dir for ensembles) decodes the EPW directly to disk and returns the path — recommended pattern. Omit it to get the base64 payload inline.

Authentication

Generate an API key at epwforge.com/account. Pass it explicitly or set EPWFORGE_API_KEY in the environment.

Plan requirements

Feature Plan
TMYx / AMY basis without SSP Starter
UHI / events / smoke adjustments Starter
ssp= future-climate morphing Pro
c.ensemble(...) per-model CMIP6 Pro
c.stations(...) Free

The API enforces this server-side. The client surfaces 403 errors as EPWForgeError with a clear upgrade message.

Error handling

from epwforge import Client, EPWForgeError

c = Client()
try:
    c.weather_file(lat=40.71, lon=-74.01, ssp="ssp585", year=2090,
                   save_to="future.epw")
except EPWForgeError as e:
    if e.status == 429:
        print(f"Rate limited; retry in {e.retry_after}s")
    elif e.status == 403:
        print("Upgrade plan to use future-climate morphing")
    else:
        raise

Compound events

events="heatwave,hothumid" auto-blends humidity onto the heat event at 50%. events="coldsnap,coldwindy" does the same for wind onto cold. The secondary event is folded into the primary stitch (not added separately) so files don't get two events at different windows.

AR6 auto-fill under SSP

When ssp=... is set and you don't specify an event's intensity, the API fetches the IPCC AR6 ensemble factor for that (region, ssp, year, percentile, event type) and uses it as the slider value. Cold-family events are floored at 5 (no future amplification) — AR6 says cold dampens but recent observations don't yet support that, so we hold conservatively. Pass intensity_auto=False to opt out.

Context manager

with Client() as c:
    c.weather_file(lat=40.71, lon=-74.01, save_to="nyc.epw")
    # connection pool closed automatically on exit

Links

License

MIT

Release files for epwforge 0.1.0

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

Source distribution (sdist)

Source distribution for epwforge 0.1.0
File Size Uploaded
epwforge-0.1.0.tar.gz 7.6 kB Details

Built distribution (wheel)

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

Total release size: 16.6 kB

Release files / epwforge-0.1.0.tar.gz

Download URL epwforge-0.1.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b0e35fd8efd767b5aaad17eb052a9ee90906349fe2f1f9f449a5ee26db44d67f
BLAKE2b-256 checksum
How to use checksums
b231190a1d01dc4bca897d0276ee2758b6015fecf75397753dbece62461da50b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / epwforge-0.1.0-py3-none-any.whl

Download URL epwforge-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
803b19c8292b9a7e2fde2eaf10053cae1f99246c67f6d017355c3db21c0974cc
BLAKE2b-256 checksum
How to use checksums
f378afcb46b783b6ca6ff4e7b45d5e5bf131c2cc66c03ec8aa907e8de4e8a10f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release 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