Skip to main content

XWeather to EPW Converter

A tool that fetches data from the XWeather API and generates a full year AMY (Actual Meteorological Year) EnergyPlus Weather file (EPW).

The tool takes care of fetching the necessary data from the API, processing it, and formatting it into the EPW format. It's designed for fast and efficient data retrieval.

Installation

Prerequisites

You need to have a XWeather API access. Note that at hourly frequency (which is used for EPW generation), each day of data costs 1 API request.

Install the package

From source

Clone the current repository and install the required dependencies using Poetry:

git clone https://github.com/airboxlab/xweather2epw.git
cd xweather2epw
poetry install

Usage

Example usage:

# using poetry, execute in local repository
poetry run xweather2epw fetch --from '2025-01-01' --to '2025-12-31' --latitude 49.4 --longitude 0.1 --api-key YOUR_KEY --api-secret YOUR_SECRET

# specify a custom output file
poetry run xweather2epw fetch --from '2025-01-01' --to '2025-12-31' --latitude 49.4 --longitude 0.1 --api-key YOUR_KEY --api-secret YOUR_SECRET --output my_weather.epw

Use --help to have a list of available options:

poetry run xweather2epw --help
poetry run xweather2epw fetch --help

Development

Running Tests

To run the test suite:

poetry run test

This will execute all unit tests with verbose output.

Features

  • Date Range Validation: Validates input parameters (latitude, longitude, date range)
  • Smart Chunking: Automatically splits requests into 15-day chunks to comply with API limits
  • Date Range Limits:
    • Maximum duration: 1 year (365 days)
    • Forecast limit: Up to 14 days in the future
  • Missing Data Handling: Uses safe default values for missing weather data
  • Unit Conversion: Automatically converts units to comply with EPW format (SI units)
  • EPW Header Generation: Populates EPW headers with location information from API response
  • Solar Radiation Data: Extracts solar radiation data from XWeather API's solrad field (GHI, DNI, DHI)
  • Sequential Processing: Processes data chunks sequentially for reliability

Limitations

  • Ground/soil temperatures cannot be calculated from XWeather API data, so the GROUND TEMPERATURES header is set to 0
  • Some advanced EPW fields (like extraterrestrial radiation and illuminance) are not available from the XWeather conditions endpoint and are filled with missing data indicators
  • Historical data availability depends on your XWeather API subscription

Documentation

Metadata

Release files for xweather2epw 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 xweather2epw 0.1.0
File Size Uploaded Provenance Actions
xweather2epw-0.1.0.tar.gz 10.4 kB Without provenance Details for xweather2epw-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 21.8 kB

Release files / xweather2epw-0.1.0.tar.gz

Download URL xweather2epw-0.1.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
887b12a904054b54387dba10a7613b8e49899afc4015de850b5aaa8dcebb13cc
BLAKE2b-256 checksum
How to use checksums
1793be0ac567098be7da6c3f83d905a74307ea58618b2a3a8ebe4153894949cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.8.0-117-generic

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

Download URL xweather2epw-0.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a481bc11c2526fa8b84088fb17d36ee85965fcbdb5b8a3980432fa37e6cb0bb
BLAKE2b-256 checksum
How to use checksums
ab563aebc0d9789446af60bd75fdec8634f34bdef7d6352eeecf02b61f116d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.8.0-117-generic

Security for xweather2epw 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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