Skip to content

Climate Toolkit

Location-based climate analysis for agriculture: fetch daily climate data, compute seasonal climatologies and drought indices, assess crop and livestock hazards, and compare periods, data sources, and weather stations — for any point location.

Try it in your browser — no install

Open In Colab

The companion Colab notebook installs the package and runs the credential-free examples end-to-end on a free Google-hosted runtime.

Install

pip install "git+https://github.com/CGIAR-Climate-Data-Hub/climate-toolkit.git"

Quick start

import climate_toolkit as ct
from datetime import date

df = ct.fetch_climate_data(
    source="nasa_power",              # needs no credentials
    location_coord=(-1.286, 36.817),  # Nairobi
    date_from=date(2020, 1, 1),
    date_to=date(2020, 12, 31),
)
df.head()

nasa_power works with zero setup. The Earth Engine-backed sources (agera_5, era_5, chirps_v3_daily_rnl, nex_gddp) need a free one-time authentication — see Getting started.

What's in the box

Function Purpose
fetch_climate_data Daily climate data for a site as a pandas DataFrame
analyze_climate_statistics Seasonal climatology, water balance, SPI/SPEI
evaluate_hazards Crop & livestock hazard assessment for a season
compare_climate_periods Focal year vs. baseline climatology
compare_climate_sources Side-by-side gridded dataset comparison
download_station_data Daily observations from nearby weather stations
compare_station_to_grids Validate gridded data against stations

Every function is also available as a CLI command (climate-toolkit <command>); see the workflow guides in the navigation.

Funding & acknowledgements

This toolkit was developed as part of the project Advancing Climate Data Integration in Agroecological Research, funded by the McKnight Foundation through its Global Collaboration for Resilient Food Systems (CRFS) programme. The work was led by the Alliance of Bioversity International and CIAT, in partnership with AIMS Rwanda.

This work was supported by the CGIAR Climate Data Hub (CDH), part of the CGIAR Climate Action Program (Area of Work 1). We acknowledge the CGIAR Trust Fund and its contributors.

The McKnight Foundation CGIAR Climate Action