Skip to main content

A tool that fetches data from the XWeather API and generates EnergyPlus Weather files (EPW)

Project description

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

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

xweather2epw-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

xweather2epw-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xweather2epw-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.8.0-117-generic

File hashes

Hashes for xweather2epw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 887b12a904054b54387dba10a7613b8e49899afc4015de850b5aaa8dcebb13cc
MD5 d99996f4b21d03f51bc142277e8cad25
BLAKE2b-256 1793be0ac567098be7da6c3f83d905a74307ea58618b2a3a8ebe4153894949cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xweather2epw-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.8.0-117-generic

File hashes

Hashes for xweather2epw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a481bc11c2526fa8b84088fb17d36ee85965fcbdb5b8a3980432fa37e6cb0bb
MD5 f3692c23f0a0aac076c9b3d79c7bd351
BLAKE2b-256 ab563aebc0d9789446af60bd75fdec8634f34bdef7d6352eeecf02b61f116d46

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