Solutions Projects Blog Process Founder ↳ Portfolio: the founder story Start a project
← Back to AidBio Open source · Beta
AidBio open tools · AidWeather

Weather and solar data, already cleaned up.

AidWeather is a small Python library and command-line tool that pulls agroclimatic and solar-radiation data straight from NASA's POWER API — and hands it back as tidy, analysis-ready tables for data analytics and machine-learning workflows. You ask for a place and a date range; it deals with the requests, retries, caching, and units so you don't have to.

18 Weather, solar & soil parameters, unit-validated
3 shapes Point, transect, and regional sampling
SQLite Built-in caching, no repeat downloads
Python + CLI Use it in a notebook or the terminal
What it does

The awkward parts of NASA POWER, handled for you.

NASA POWER is a free public dataset, but talking to it directly means building request URLs, handling timeouts and retries, checking payload shapes, and reconciling units and grids yourself. AidWeather does that work for you, so what you get back is a table you can start analyzing right away — in a statistical model, a machine-learning pipeline, or an AI-assisted workflow.

Direct NASA POWER access

Builds the request, handles timeouts and retries, and checks the response shape — so you call one method instead of writing that logic yourself.

Point, path, or region

Fetch a single coordinate, sample along a 1D transect, or pull a 2D bounding box — with internal tuning so the spatial sampling stays accurate and consistent.

Caching & API compliance

A built-in SQLite cache means the same query is never downloaded twice — saving bandwidth and respecting NASA POWER's rate limits and usage policy.

Python API + full CLI

Two ways in: a Python API for notebooks and scripts, and a command-line tool for quick, scriptable extractions.

Clear errors & logging

Logs what each query did, and raises specific error types with a plain-language message — instead of a raw stack trace.

Weather, solar & soil together

Temperature, humidity, wind, precipitation, pressure, solar irradiance / PAR, and soil wetness (surface, root-zone, profile) — the meteorological, energy, and soil-moisture variables agritech work usually needs, side by side.

Three ways to sample space

Match the query to the question.

The same client fetches a single site, a line across a landscape, or a filled-in region — each respecting the native grid spacing of the parameters you ask for.

get_point_data

A single point

One latitude/longitude and a date range returns a clean daily or hourly series for that site — the everyday case for a field, a station, or a trial plot.

get_transect_data

Along a transect

Give a start and end coordinate and a spacing in kilometres; AidWeather samples evenly along the line, respecting each parameter's real grid resolution.

fetch-regional

Across a region

Define a bounding box (up to 4.5° × 4.5°) and pull a gridded field over the whole area — one parameter per request, cached like everything else.

Quick start

A few lines to your first dataset.

Whether you live in notebooks or the terminal, getting a table of weather and solar data is a short trip.

Python
from aidweather import PowerClient, GeoCoordinate

# Daily temporal resolution
client = PowerClient(temporal_api="daily")

# 1 · single-point weather + solar
df = client.get_point_data(
    lat=-23.55, lon=-46.63,
    start="2023-01-01", end="2023-01-31",
    params=["T2M", "ALLSKY_SFC_SW_DWN", "PRECTOTCORR"],
)
print(df.head())

# 2 · sample along a 1D transect
a = GeoCoordinate.from_decimal(-25.0, -48.0)
b = GeoCoordinate.from_decimal(-20.0, -48.0)

df_t = client.get_transect_data(
    start_coord=a, end_coord=b,
    start="2023-01-01", end="2023-01-07",
    params=["T2M"], spacing_km=100.0,
)
Command line
# single-point data → CSV
aidweather fetch --lat -23.55 --lon -46.63 \
    --start 2023-01-01 --end 2023-01-31 \
    --params T2M,PRECTOTCORR --output point.csv

# sample along a 1D transect
aidweather fetch-transect \
    --lat-start -25.0 --lon-start -48.0 \
    --lat-end   -20.0 --lon-end   -48.0 \
    --start 2023-01-01 --end 2023-01-31 \
    --spacing-km 100.0

# regional box (max 4.5° × 4.5°, 1 param)
aidweather fetch-regional --lat-min -23.5 --lat-max -20.0 \
    --lon-min -47.0 --lon-max -44.0 \
    --start 2023-01-01 --end 2023-01-31 \
    --params T2M --output regional.csv

# inspect metadata & local cache
aidweather params list --group all
aidweather params describe T2M
aidweather cache info
Installation

One command to get going.

AidWeather is published on PyPI. Use pip for the Python library, or uv tool to get the CLI as an isolated tool.

Python (pip)
# install the library
pip install aidweather
CLI (uv tool)
# install the CLI as an isolated tool
uv tool install aidweather

From source / development install:

Unix / macOS
# install script (clones from GitHub, adds dev tooling)
curl -fsSL https://raw.githubusercontent.com/\
matiollipt/aidweather/main/install.sh | bash

# …or latest unreleased main via uv tool
uv tool install \
  git+https://github.com/matiollipt/aidweather.git
Windows · PowerShell
& ([scriptblock]::Create((irm https://raw\
.githubusercontent.com/matiollipt/aidweather/\
main/install.ps1))) -Yes
Parameter catalogue

18 core parameters, with the grid facts built in.

Each parameter ships with metadata, unit validation, and its native NASA source-grid resolution — so you always know what a value means and where it came from. Weather, solar, and soil-moisture parameters are all daily; the three soil parameters (GWETTOP, GWETROOT, GWETPROF) aren't available at hourly resolution.

Code Parameter Group Source product Native grid Daily unit
T2MTemperature at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
T2M_MAXMaximum temperature at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
T2M_MINMinimum temperature at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
T2M_RANGEDiurnal temperature range at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
T2MWETWet-bulb temperature at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
T2MDEWDew-point temperature at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
TSSurface skin temperatureMeteoMERRA-2 / GEOS-IT0.50° × 0.625°°C
RH2MRelative humidity at 2 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°%
PRECTOTCORRCorrected total precipitationMeteoMERRA-2 / GEOS-IT0.50° × 0.625°mm/day
ALLSKY_SFC_SW_DWNSurface shortwave downward irradianceSolarCERES SYN1deg / SRB1.00° × 1.00°kWh/m²/day
ALLSKY_SFC_PAR_TOTSurface PAR totalSolarCERES SYN1deg / SRB1.00° × 1.00°MJ/m²/day
WS10MWind speed at 10 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°m/s
WS10M_MAXMaximum wind speed at 10 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°m/s
WD10MWind direction at 10 mMeteoMERRA-2 / GEOS-IT0.50° × 0.625°degrees
PSSurface pressureMeteoMERRA-2 / GEOS-IT0.50° × 0.625°kPa
GWETTOPSurface soil wetnessSoilMERRA-2 / GEOS-IT0.50° × 0.625°0–1
GWETROOTRoot-zone soil wetnessSoilMERRA-2 / GEOS-IT0.50° × 0.625°0–1
GWETPROFProfile soil moistureSoilMERRA-2 / GEOS-IT0.50° × 0.625°0–1

A coordinate is a grid cell, not a pinpoint

A coordinate you submit resolves to a source-product grid cell — it isn't a point measurement at your exact latitude and longitude. Different parameters come from different source products (MERRA-2 at 0.5° × 0.625°, CERES solar radiation at 1.0° × 1.0°), so nearby coordinates that map to the same cell return identical series.

AidWeather keeps this provenance visible so your spatial interpretation stays honest.

Open access · Apache-2.0

Free data, with the attribution it deserves.

NASA POWER data are open access and free of charge. Work that uses AidWeather should cite the NASA POWER project and acknowledge the underlying MERRA-2 / GEOS-IT and CERES / FLASHFlux / SRB source products, per the NASA Earthdata Data Use and Attribution Policy.