Skip to main content

Agent-friendly helpers for the xmACIS2Py climate library — station discovery, multi-station fetch, and seasonal/monthly composites. Ships with the acis-weather skill.

Project description

acis2llm

Agent-friendly helpers for the xmACIS2Py climate library — plus the acis-weather skill that teaches an LLM how to use them.

acis2llm adds three things on top of xmacis2py:

  1. Station discovery — resolve "Denver, CO" / "10001" / "KNYC" → ACIS station ID
  2. Multi-station fetch — comma-aggregate ("KNYC,KJFK") and plus-backfill ("KNYC+OLDER") syntax
  3. Composite analyses — seasonal/monthly aggregates and threshold frequencies, computed across many years in one call

The bulk of the value lives in skills/acis-weather/ — a complete agent skill with an agentskills.io-compliant SKILL.md and 5 reference docs covering xmACIS2Py + the helpers + worked recipes.


Install

This project uses uv. Install it first if you don't have it.

uv pip install xmacis2py acis2llm

Or for one-off scripts without managing a venv:

uv run --with xmacis2py --with acis2llm python your_script.py

Requires Python 3.10+ and network access to data.rcc-acis.org, geocoding.geo.census.gov, and api.zippopotam.us. No API keys.


Use the skill (the agent path)

If you're driving an LLM agent (Claude Code, Cursor, Gemini CLI, OpenCode, etc.), point it at the skill and it will know what to do:

# Copy or symlink skills/acis-weather into your client's skills directory.
# For Claude Code:
ln -s "$PWD/skills/acis-weather" ~/.claude/skills/acis-weather

# For project-scoped use, drop it under .claude/skills/ in your repo:
ln -s "$(pwd)/skills/acis-weather" /path/to/project/.claude/skills/acis-weather

The skill is a single SKILL.md (under 500 lines) plus references/ files the agent loads on demand. See the agentskills.io spec for the format.


Use the library directly (the human path)

import xmacis2py
import acis2llm

# 1. Resolve "Denver, CO" → station ID
stn = acis2llm.find_best_station("Denver, CO")
# {'station_id': 'KDEN', 'name': 'DENVER INTL ARPT, CO', 'data_start': 1948, ...}

# 2. Single-station fetch
df = xmacis2py.get_single_station_acis_data(
    stn["station_id"],
    start_date="2023-06-01",
    end_date="2023-08-31",
)

# 3. Multi-station aggregate (comma) or backfill (plus)
df = acis2llm.fetch_stations(
    "KNYC,KBOS,KORD",
    from_when="yesterday",
    time_delta=30,
)

# 4. Cross-year composite — "snowiest winters in Buffalo"
result = acis2llm.seasonal_summary(
    station="KBUF",
    variable="snow",
    season="winter",
    aggregation="sum",
)
top5 = sorted(result["table"], key=lambda r: r["value"] or 0, reverse=True)[:5]

# 5. Per-period stat — pair fetch + analysis
from xmacis2py import analysis
df = xmacis2py.get_single_station_acis_data("KPHX", start_date="2023-06-01", end_date="2023-08-31")
days_over_110 = analysis.number_of_days_above_value(df, "Maximum Temperature", 110)

For the full API surface see skills/acis-weather/references/acis2llm-api.md. For end-to-end recipes see skills/acis-weather/references/recipes.md.


Variables

Short Full xmACIS2Py column Unit
tmax Maximum Temperature °F
tmin Minimum Temperature °F
tavg Average Temperature °F
tdpa Average Temperature Departure °F
prcp Precipitation inches
snow Snowfall inches
snow_depth Snow Depth inches
hdd / cdd / gdd Heating / Cooling / Growing Degree Days base 65/65/32°F
awdb Average Daily Water Balance inches

acis2llm's composite functions accept short codes; xmACIS2Py's analysis functions take the full column names. acis2llm.VARIABLE_COLUMN_MAP exports the mapping.


Development

uv sync --extra dev
uv run pytest

Layout

.
├── src/acis2llm/
│   ├── __init__.py             public API re-exports
│   ├── geocoding.py            find_best_station, geocode_census, is_zip_code
│   ├── composites.py           seasonal_summary, monthly_totals_by_year, ...
│   └── multi_station.py        fetch_stations (comma + plus syntax)
├── skills/acis-weather/
│   ├── SKILL.md                agent-facing playbook (agentskills.io v1)
│   └── references/             vendored xmACIS2Py docs + recipes + API ref
└── tests/
    ├── test_composites.py
    └── test_multi_station.py

Credits

  • Data: Regional Climate Centers via the Applied Climate Information System.
  • Engine: xmACIS2Py by Eric J. Drewitz (@edrewitz) — MIT-licensed. Documentation in skills/acis-weather/references/xmacis2py-*.md is vendored from upstream and reformatted; original copyright preserved.

License: MIT — see LICENSE.

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

acis2llm-0.2.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

acis2llm-0.2.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file acis2llm-0.2.0.tar.gz.

File metadata

  • Download URL: acis2llm-0.2.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for acis2llm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 43dc05dbac0d321e1446fe50661a611c19958d7c12e745419ca9d38a866efd31
MD5 e1b566b0dd3dd367fd905c3885418ef2
BLAKE2b-256 2112dd37e36b0c7d13b890757450b37c2a4e791bb2f63a5ac8d3f27b306aaaeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for acis2llm-0.2.0.tar.gz:

Publisher: publish.yml on yenba/ACIS2LLM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file acis2llm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: acis2llm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for acis2llm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd92879ff19e4c9b2d7ceec0d18ed8b5725a4d68e89994dcefff7748eb3d85cb
MD5 4d9524ef3ce1d121179de7afd65f1236
BLAKE2b-256 6f406dbc23e42bde91551af12b4d5628f9fcc1198512e451c4dfd39b9b65f9c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for acis2llm-0.2.0-py3-none-any.whl:

Publisher: publish.yml on yenba/ACIS2LLM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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