Skip to main content

foehn

MeteoSwiss Open Data — Python API, CLI & MCP server · tabular as DataFrames/Parquet, gridded as xarray/Zarr

PyPI Latest Release Python Versions MIT License OpenSSF Scorecard Monthly Downloads CI Documentation


foehn downloads every MeteoSwiss OGD collection via the STAC API, converts CSV/TXT station data to Parquet with Polars, and opens gridded collections — NetCDF climate grids, GRIB2 forecasts, and ODIM radar composites — as xarray Datasets or Zarr stores. It can optionally ingest everything into Databricks Unity Catalog Delta tables on a daily schedule, and ships an MCP server so LLMs can query Swiss weather data directly.

Daily weather in Bern, powered by foehn

Daily weather in Bern, powered by foehn's MCP server and MeteoSwiss open data.

Why foehn?

  • 20+ collections in one command — weather stations, radar, hail maps, forecasts, climate scenarios, and more
  • Tabular and gridded — CSV station data as Polars DataFrames or Parquet; NetCDF, GRIB2 and ODIM radar grids as xarray Datasets or Zarr stores
  • MCP server for LLMs — give your favorite LLM live access to MeteoSwiss data with the MCP server
  • Significantly smaller on disk — columnar Parquet with Zstandard compression vs. raw CSVs
  • Incremental by default — only re-downloads files that changed since your last run, tracked per dataset and time slice in _last_run.json
  • No Spark required locally — download + conversion uses Polars only; Spark is optional for Delta ingestion
  • Ships a Declarative Automation Bundle — ready-to-deploy daily job and historical backfill, no pipeline config needed

Quick start

pip install foehn
foehn download

Recent data (Jan 1 to yesterday) is downloaded and converted to Parquet under ./data/meteoswiss/.

foehn CLI demo

Installation

From PyPI:

pip install foehn       # or: uv add foehn

As a standalone CLI (in its own isolated environment):

uv tool install foehn   # or: pipx install foehn
uvx foehn list          # run once without installing

From source:

git clone https://github.com/kayhendriksen/foehn
cd foehn
uv sync                 # see CONTRIBUTING.md

With extras:

pip install "foehn[databricks]"   # PySpark + Delta, and Polars' build for CPUs without AVX2
pip install "foehn[mcp]"          # MCP server
pip install "foehn[grids]"        # xarray + Zarr for all gridded data (NetCDF, GRIB2, radar)

Requires Python 3.11 or later.


Python API

import foehn

df = foehn.load("smn", station="BER", frequency="d")

Load data directly into Polars DataFrames, explore metadata, download to disk, and convert to Parquet — all from Python. See the full Python API documentation.


CLI

foehn download smn pollen
foehn load smn --station BER --frequency d
foehn load smn --station BER --frequency d --output-format csv > ber.csv
foehn metadata stations smn --output-format json | jq '.[].name'

The CLI mirrors the Python API with subcommands for downloading, converting, loading, and inspecting metadata. Tables are printed for people and CSV/JSON for pipelines, with progress and errors kept on stderr. See the full CLI documentation.


Gridded data

ds = foehn.open_dataset("surface_derived_grid", match="rhiresd")  # NetCDF climate grid
ds = foehn.open_dataset("forecast_icon_ch1", match="YYYYMMDDHHMM-0-t_2m-ctrl")  # one GRIB2 field
ds = foehn.open_dataset("radar_precip", match="cpcYYDDDHHMM")  # one radar composite
# Forecast and radar files roll off after a day / two weeks: fill in a recent time.
# A match that finds nothing lists the times the collection holds now.
foehn.to_zarr("surface_derived_grid", match="rhiresd")  # Zarr store

NetCDF climate grids/normals/scenarios, GRIB2 forecasts (ICON-CH1/CH2, KENDA), and HDF5/ODIM radar composites all open as xarray Datasets instead of DataFrames. One extra covers them: pip install "foehn[grids]". See the gridded data documentation.


MCP server

{
  "mcpServers": {
    "foehn": {
      "command": "foehn",
      "args": ["mcp"]
    }
  }
}

Give any MCP-compatible LLM live access to MeteoSwiss data. See the full MCP server documentation.


Documentation

The full documentation, including the API reference, is at kayhendriksen.github.io/foehn.

Collections All 20+ MeteoSwiss datasets, categories, and time slice conventions
Python API Loading data, metadata, downloading, and Parquet conversion
Gridded data NetCDF grids as xarray Datasets and Zarr stores
CLI All subcommands, flags, and environment variables
MCP Server Setup, configuration, and available tools
Databricks Pipeline Declarative Automation Bundle deployment
Changelog What changed in every release
Contributing Development setup, tests, conventions and releases

Data sources

STAC API https://data.geo.admin.ch/api/stac/v1
Documentation https://opendatadocs.meteoswiss.ch
MeteoSwiss OGD https://github.com/MeteoSwiss/opendata

Contributing

Contributions are welcome — see CONTRIBUTING.md for the development setup and conventions, and include the output of foehn version in bug reports. Everyone taking part follows the Code of Conduct.


License

MIT

Metadata

Release files for foehn 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foehn 0.5.1
File Size Uploaded Provenance Actions
foehn-0.5.1.tar.gz 3.0 MB With provenance Details for foehn-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for foehn 0.5.1
File Interpreter ABI Platform Actions
foehn-0.5.1-py3-none-any.whl Python 3 none any Details for foehn-0.5.1-py3-none-any.whl

Total release size: 3.2 MB

Release files / foehn-0.5.1.tar.gz

Download URL foehn-0.5.1.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
6fa55a792963352c94ab48bce18ae064d62af11fcef79c3e213a673671953c52
BLAKE2b-256 checksum
How to use checksums
51ae6448b88a013010510c561080f8631fb44b1f3f74d332bd90646beedd2b3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / foehn-0.5.1-py3-none-any.whl

Download URL foehn-0.5.1-py3-none-any.whl
Size 157.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42f2215f69ce9c7a144a3c7e89ffed175c73670ffba520a651742b08f546967b
BLAKE2b-256 checksum
How to use checksums
ccccb3f75bc0d9867f7b67803274cff99098b958f707d9bd7846b5edf99e2aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for foehn 0.5.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for foehn-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files Full provenance

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