{
  "markdown": "<h1 align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/kayhendriksen/foehn/main/assets/banner.svg\" alt=\"foehn\" width=\"600\">\n</h1>\n\n<p align=\"center\">\n  <strong>MeteoSwiss Open Data — Python API, CLI & MCP server · tabular as DataFrames/Parquet, gridded as xarray/Zarr</strong>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/foehn/\">\n    <img src=\"https://img.shields.io/pypi/v/foehn.svg\" alt=\"PyPI Latest Release\">\n  </a>\n  <a href=\"https://pypi.org/project/foehn/\">\n    <img src=\"https://img.shields.io/pypi/pyversions/foehn.svg\" alt=\"Python Versions\">\n  </a>\n  <a href=\"https://github.com/kayhendriksen/foehn/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"MIT License\">\n  </a>\n  <a href=\"https://scorecard.dev/viewer/?uri=github.com/kayhendriksen/foehn\">\n    <img src=\"https://api.scorecard.dev/projects/github.com/kayhendriksen/foehn/badge\" alt=\"OpenSSF Scorecard\">\n  </a>\n  <a href=\"https://pypi.org/project/foehn/\">\n    <img src=\"https://img.shields.io/pypi/dm/foehn.svg\" alt=\"Monthly Downloads\">\n  </a>\n</p>\n\n---\n\nfoehn downloads every [MeteoSwiss OGD](https://github.com/MeteoSwiss/opendata) collection via the STAC API, converts CSV/TXT station data to Parquet with [Polars](https://pola.rs), and opens gridded collections — NetCDF climate grids, GRIB2 forecasts, and ODIM radar composites — as [xarray](https://xarray.dev) Datasets or [Zarr](https://zarr.dev) stores. It can optionally ingest everything into [Databricks](https://www.databricks.com) Unity Catalog Delta tables on a daily schedule, and ships an [MCP server](https://modelcontextprotocol.io) so LLMs can query Swiss weather data directly.\n\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/kayhendriksen/foehn/main/assets/mcp_demo.png\" alt=\"Daily weather in Bern, powered by foehn\" width=\"700\">\n</p>\n<p align=\"center\">\n  <em>Daily weather in Bern, powered by foehn's MCP server and MeteoSwiss open data.</em>\n</p>\n\n## Why foehn?\n\n- **20+ collections in one command** — weather stations, radar, hail maps, forecasts, climate scenarios, and more\n- **Tabular and gridded** — CSV station data as Polars DataFrames or Parquet; NetCDF, GRIB2 and ODIM radar grids as xarray Datasets or Zarr stores\n- **MCP server for LLMs** — give your favorite LLM live access to MeteoSwiss data with the MCP server\n- **Significantly smaller on disk** — columnar Parquet with Zstandard compression vs. raw CSVs\n- **Incremental by default** — only re-downloads files that changed since your last run, tracked via `_last_run.json`\n- **No Spark required locally** — download + conversion uses Polars only; Spark is optional for Delta ingestion\n- **Ships a Declarative Automation Bundle** — ready-to-deploy daily job and historical backfill, no pipeline config needed\n\n---\n\n## Quick start\n\n```bash\npip install foehn\nfoehn download\n```\n\nRecent data (Jan 1 to yesterday) is downloaded and converted to Parquet under `./data/meteoswiss/`.\n\n<img src=\"https://raw.githubusercontent.com/kayhendriksen/foehn/main/assets/cli_demo.gif\" alt=\"foehn CLI demo\" width=\"800\">\n\n---\n\n## Installation\n\n**From PyPI:**\n```bash\npip install foehn\n```\n\n**From source:**\n```bash\ngit clone https://github.com/kayhendriksen/foehn\ncd foehn\npip install -e .\n```\n\n**With extras:**\n```bash\npip install \"foehn[databricks]\"   # PySpark + Delta\npip install \"foehn[mcp]\"          # MCP server\npip install \"foehn[grids]\"        # xarray + Zarr for all gridded data (NetCDF, GRIB2, radar)\n```\n\nRequires Python 3.11 or later.\n\n---\n\n## Python API\n\n```python\nimport foehn\n\ndf = foehn.load(\"smn\", station=\"BER\", frequency=\"d\")\n```\n\nLoad data directly into Polars DataFrames, explore metadata, download to disk, and convert to Parquet — all from Python. See the [full Python API documentation](docs/python-api.md).\n\n---\n\n## CLI\n\n```bash\nfoehn download smn pollen\nfoehn load smn --station BER --frequency d\n```\n\nThe CLI mirrors the Python API with subcommands for downloading, converting, loading, and inspecting metadata. See the [full CLI documentation](docs/cli.md).\n\n---\n\n## Gridded data\n\n```python\nds = foehn.open_dataset(\"surface_derived_grid\", match=\"rhiresd\")  # NetCDF climate grid\nds = foehn.open_dataset(\"forecast_icon_ch1\", match=\"202605231500-0-t_2m-ctrl\")  # one GRIB2 field\nds = foehn.open_dataset(\"radar_precip\", match=\"cpc2613000000\")    # one radar composite\nfoehn.to_zarr(\"surface_derived_grid\", match=\"rhiresd\")            # Zarr store\n```\n\nNetCDF 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](docs/grids.md).\n\n---\n\n## MCP server\n\n```json\n{\n  \"mcpServers\": {\n    \"foehn\": {\n      \"command\": \"foehn\",\n      \"args\": [\"mcp\"]\n    }\n  }\n}\n```\n\nGive any MCP-compatible LLM live access to MeteoSwiss data. See the [full MCP server documentation](docs/mcp-server.md).\n\n---\n\n## Documentation\n\n| | |\n|---|---|\n| [Collections](docs/collections.md) | All 20+ MeteoSwiss datasets, categories, and time slice conventions |\n| [Python API](docs/python-api.md) | Loading data, metadata, downloading, and Parquet conversion |\n| [Gridded data](docs/grids.md) | NetCDF grids as xarray Datasets and Zarr stores |\n| [CLI](docs/cli.md) | All subcommands, flags, and environment variables |\n| [MCP Server](docs/mcp-server.md) | Setup, configuration, and available tools |\n| [Databricks Pipeline](docs/databricks.md) | Declarative Automation Bundle deployment |\n\n---\n\n## Data sources\n\n| | |\n|---|---|\n| STAC API | https://data.geo.admin.ch/api/stac/v1 |\n| Documentation | https://opendatadocs.meteoswiss.ch |\n| MeteoSwiss OGD | https://github.com/MeteoSwiss/opendata |\n\n---\n\n## License\n\nMIT\n\n<!-- mcp-name: io.github.kayhendriksen/foehn -->\n",
  "bytes": 5822,
  "sha": "1e7567003297a0f0f44ea74b23280bf53dae9620bd175e67f08aa1d7a86b0912",
  "repo_slug": "kayhendriksen/foehn",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kayhendriksen_foehn_f97faf47/readme"
}