Skip to main content

Python client for EPWForge — generate climate-stressed EPW weather files for any global location. Custom TMYx / AMY from ERA5, CMIP6 future-climate morphing across SSP scenarios, urban heat island, extreme-event injection (heat waves, cold snaps, compound humidity/wind), and wildfire smoke overlays. For EnergyPlus, OpenStudio, IES VE, eQUEST.

Project description

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

Project details


Download files

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

Source Distribution

epwforge-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

epwforge-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file epwforge-0.1.0.tar.gz.

File metadata

  • Download URL: epwforge-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for epwforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0e35fd8efd767b5aaad17eb052a9ee90906349fe2f1f9f449a5ee26db44d67f
MD5 cc14d272683614ebb186adc5f934ab1c
BLAKE2b-256 b231190a1d01dc4bca897d0276ee2758b6015fecf75397753dbece62461da50b

See more details on using hashes here.

File details

Details for the file epwforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: epwforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for epwforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 803b19c8292b9a7e2fde2eaf10053cae1f99246c67f6d017355c3db21c0974cc
MD5 f6f72089bea30cd0fa44c726cab6b409
BLAKE2b-256 f378afcb46b783b6ca6ff4e7b45d5e5bf131c2cc66c03ec8aa907e8de4e8a10f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page