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.
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.
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.
Builds the request, handles timeouts and retries, and checks the response shape — so you call one method instead of writing that logic yourself.
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.
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.
Two ways in: a Python API for notebooks and scripts, and a command-line tool for quick, scriptable extractions.
Logs what each query did, and raises specific error types with a plain-language message — instead of a raw stack trace.
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.
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.
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.
Give a start and end coordinate and a spacing in kilometres; AidWeather samples evenly along the line, respecting each parameter's real grid resolution.
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.
Whether you live in notebooks or the terminal, getting a table of weather and solar data is a short trip.
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, )
# 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
AidWeather is published on PyPI. Use pip for the Python library, or uv tool to get the CLI as an isolated tool.
# install the library
pip install aidweather
# install the CLI as an isolated tool
uv tool install aidweather
From source / development install:
# 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
& ([scriptblock]::Create((irm https://raw\ .githubusercontent.com/matiollipt/aidweather/\ main/install.ps1))) -Yes
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 |
|---|---|---|---|---|---|
T2M | Temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2M_MAX | Maximum temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2M_MIN | Minimum temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2M_RANGE | Diurnal temperature range at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2MWET | Wet-bulb temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
T2MDEW | Dew-point temperature at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
TS | Surface skin temperature | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | °C |
RH2M | Relative humidity at 2 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | % |
PRECTOTCORR | Corrected total precipitation | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | mm/day |
ALLSKY_SFC_SW_DWN | Surface shortwave downward irradiance | Solar | CERES SYN1deg / SRB | 1.00° × 1.00° | kWh/m²/day |
ALLSKY_SFC_PAR_TOT | Surface PAR total | Solar | CERES SYN1deg / SRB | 1.00° × 1.00° | MJ/m²/day |
WS10M | Wind speed at 10 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | m/s |
WS10M_MAX | Maximum wind speed at 10 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | m/s |
WD10M | Wind direction at 10 m | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | degrees |
PS | Surface pressure | Meteo | MERRA-2 / GEOS-IT | 0.50° × 0.625° | kPa |
GWETTOP | Surface soil wetness | Soil | MERRA-2 / GEOS-IT | 0.50° × 0.625° | 0–1 |
GWETROOT | Root-zone soil wetness | Soil | MERRA-2 / GEOS-IT | 0.50° × 0.625° | 0–1 |
GWETPROF | Profile soil moisture | Soil | MERRA-2 / GEOS-IT | 0.50° × 0.625° | 0–1 |
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.
The docs are split into focused guides — start with the user guide, dip into provenance and spatial interpretation when you need the details.
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.