Skip to main content

weather-skills-core

Note. This repository is intended for weather-skills developers. If you are a weather-skills user, call the skills directly in your favorite AI interface — start at weather-skills.org.

Weather skills turn scientific weather-data pipelines into fixed, reviewable tools that are meant for agentic AI. You write each step in ordinary Python: fetch a forecast or satellite rainfall field, clip it to a country, convert units, make a map. Wrapping the function with @weather_skill gives it a command line, shared flags such as --bbox and --start-time, and a common Zarr layout so one step's output is the next step's input. Each output file carries provenance: a record of which skill, version, and arguments produced it, so someone else can rerun or check the chain. The skill is the script you checked in; nothing is generated at runtime unless you want it to be.

Composable weather skills: fetchers write a standard Zarr, transforms take Zarr to Zarr, and a figure skill writes a PNG

A pipeline from the weather-skills collection — weekly CHIRPS rainfall totals over Kenya:

uv run skills/chirps-fetch/scripts/fetch.py \
  --bbox 5/34/-5/42 --start-time 2026-03-01 --end-time 2026-03-28 -o chirps.zarr
uv run skills/aggregate-temporal/scripts/aggregate.py -i chirps.zarr --period weekly -o weekly.zarr
uv run skills/convert-to-totals/scripts/convert_to_totals.py -i weekly.zarr -o totals.zarr

Writing a skill

from weather_skills_core import Dataset, weather_skill
from weather_skills_core.standard_utils import bbox_subset


@weather_skill(name="my-subset", version="0.1.0")
@weather_skill.argument("-i", "--input", type=Dataset("spatial"), required=True)
@weather_skill.argument("--bbox", required=True)
def my_subset(ds, output, bbox, **kwargs):
    return bbox_subset(ds, bbox)  # the decorator stamps provenance and writes -o


if __name__ == "__main__":
    my_subset()
uv run my_subset.py -i chirps.zarr --bbox 1/36/-2/38 -o nairobi.zarr

The decorator builds the CLI from the stacked argument calls (same kwargs as argparse.add_argument), opens and checks the input Zarr, parses --bbox into (N, W, S, E) floats, adds -o/--output, and writes whatever Dataset you return. The function only holds the domain logic.

The authoring guide covers the rest:

Question Read
How do I lay out and declare a skill? SKILL.md
What should a flag be called, and which flags are parsed for me? CONVENTIONS.md
What dims must a Zarr have, and what is written on output? STANDARD_DATASET.md
Rates vs totals, and which unit attrs to stamp? UNITS.md

Install

uv add weather-skills-core

Development

This repository is the core library (weather_skills_core) and the tools for writing skills. The skills themselves live in companion collections such as weather-skills.

uv sync
uv run pytest
uv run ruff format --check .
uv run ruff check .
uv run pre-commit run --all-files

Lint a skill, a skills/ tree, or a repo with uv run weather-skills-core lint [PATH].

Country polygons and Natural Earth region labels live in src/weather_skills_core/data/countries.geojson; resolve-region groups them at runtime, so names like East Africa need no sidecar. Rebuild the country file from Natural Earth 50m admin-0 with uv run python tools/build_countries.py (--help for the contract).

Named regions that are not countries, Natural Earth labels or admin units (e.g. Indian Ocean basin) live in src/weather_skills_core/data/custom_regions.geojson, so every skill that resolves a place name knows them. To add one, append a Feature with a Polygon or MultiPolygon geometry and properties name, aliases (a list, may be empty) and source (where the shape comes from). Its bbox is taken from the geometry. Country names and Natural Earth labels win over a custom name, and tests/test_region.py fails if a name or alias clashes with one. Keep this file to regions any user might ask for; project-specific boxes belong in a domain skill repo.

Pull requests that improve the decorator, the standard dataset contract, or the docs are welcome. The longer-term aim is an open registry of shared weather skills on the same dataset and provenance model.

Metadata

Release files for weather-skills-core 0.2.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 weather-skills-core 0.2.0
File Size Uploaded Provenance
weather_skills_core-0.2.0.tar.gz 857.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for weather-skills-core 0.2.0
File Interpreter ABI Platform
weather_skills_core-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / weather_skills_core-0.2.0.tar.gz

Download URL weather_skills_core-0.2.0.tar.gz
Size 857.7 kB
Tags Source
SHA-256 checksum
How to use checksums
525140926717221dcf595cf3292074ffc5af39dc89c33a0abf87fc5e6fbc7174
BLAKE2b-256 checksum
How to use checksums
bb9a16869f0cec38a5c8fda24ff98749889aec7482008da0b6da1817abfacdb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / weather_skills_core-0.2.0-py3-none-any.whl

Download URL weather_skills_core-0.2.0-py3-none-any.whl
Size 761.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b729d7486a1d8adba42978b74f875ed08b43e04d759e133f1d7d9badcba1cc35
BLAKE2b-256 checksum
How to use checksums
2235768975505d6156ba113a630e3f2e0ace01cd8c1167bd3c3ce1522c424b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for weather-skills-core 0.2.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.

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