Skip to content

Repository files navigation

OpenFetch

OpenFetch is a local-first terminal app and CLI for browsing, previewing, and downloading public weather, radar, observation, earthquake, and map datasets without memorizing source URLs or bucket paths.

It includes:

  • An interactive Textual TUI for selecting data sources, plot products, regions, parameters, and quick actions.
  • A Typer CLI for direct fetch commands and scripts.
  • A FastAPI local server for integrations.
  • A SQLite-backed local cache under ~/.openfetch/.
  • An npm wrapper package named openfetch-cli that installs and launches the Python app.

Status

OpenFetch is public on GitHub at:

https://github.com/ShianMike/OpenFetch

OpenFetch is published on npm as openfetch-cli:

https://www.npmjs.com/package/openfetch-cli

Requirements

  • Python 3.9+
  • Node.js and npm, only if using the npm wrapper
  • Internet access to the selected public data sources

Installation

Python Development Install

git clone https://github.com/ShianMike/OpenFetch.git
cd OpenFetch
# Option 1: Poetry
poetry install
poetry run openfetch
# Option 2: pip in a virtual environment
python -m venv .venv
.\.venv\Scripts\activate
pip install -e .
openfetch

On macOS/Linux, activate the virtual environment with:

source .venv/bin/activate

npm Registry Install

The npm wrapper creates a package-local Python virtual environment during postinstall, then installs OpenFetch into it.

npm install -g openfetch-cli
openfetch

npm Install From GitHub

Use the GitHub install path when you want the latest repository version before a new npm release.

npm install -g github:ShianMike/OpenFetch
openfetch

npm Install From Local Checkout

git clone https://github.com/ShianMike/OpenFetch.git
cd OpenFetch
npm install -g .
openfetch

Quick Start

Launch the interactive terminal UI:

openfetch

Fetch model ingredients directly:

# Latest HRRR surface CAPE
openfetch fetch hrrr sbcape
# GFS surface pressure and 10 m wind ingredients
openfetch fetch gfs sfc_mslp_wind --date 20260601 --cycle 12 --fhr 6
# GFS 2 m temperature with a Philippines plot/domain selection
openfetch fetch gfs sfc_tmp_2m --date 20260601 --cycle 12 --fhr 6 --region philippines
# ECMWF Open Data direct GRIB file
openfetch fetch ecmwf sfc_tmp_2m --date 20260601 --cycle 12 --fhr 3

Fetch non-model sources:

# GOES ABI CONUS product
openfetch fetch goes --satellite GOES-16 --product ABI-L2-MCMIPC
# NEXRAD Level II by station
openfetch fetch nexrad kltx
# SPC storm reports
openfetch fetch spc today
# METAR observations
openfetch fetch metar kord --hours 2
# USGS earthquakes
openfetch fetch usgs --minmagnitude 4.5 --hours 24
# USGS radius search
openfetch fetch usgs --minmagnitude 1.0 --hours 72 --latitude 37.7749 --longitude -122.4194 --maxradiuskm 500
# OpenStreetMap POI search
openfetch fetch osm cafe --latitude 40.7128 --longitude -74.006 --radius-km 3

CLI Reference

openfetch fetch CONNECTOR [ACTION] [OPTIONS]

Common options:

OptionUsed byDescription
--dateModels, GOES, NEXRAD, SPClatest, today, yesterday, or YYYYMMDD depending on connector
--cycleModels, GOES, NEXRADUTC cycle/hour
--fhrWeather modelsForecast hour
--regionWeather modelsRegion/domain slug such as native, global, conus, europe, western_pacific, or philippines
--satelliteGOESSatellite mission, for example GOES-16 or GOES-18
--productGOESABI product code, for example ABI-L2-MCMIPC
--hoursMETAR, USGSLookback window
--minmagnitudeUSGSMinimum earthquake magnitude
--latitude, --longitudeUSGS, OSMCenter point for radius searches
--maxradiuskmUSGSEarthquake radius in kilometers
--radius-kmOSMPOI radius in kilometers

Interactive TUI

The TUI is the main workflow for browsing sources without memorizing commands.

It supports:

  • Connector search and category browsing.
  • Quick actions for sources that do not have plot-product lists.
  • Weather-model plot-product selection.
  • Region/domain picker for models.
  • Request preview and equivalent CLI command display.
  • Cache explorer, settings, and help tabs.

Keyboard shortcuts:

KeyAction
/Focus connector search
fFetch selected dataset
cOpen cache explorer
sOpen settings
hOpen help
qQuit
Tab / Shift+TabMove focus
EnterSelect or activate
EscUnfocus input or go back

Supported Sources

Weather Models

ConnectorAliasesSourceNotes
HRRRhrrr, noaa-hrrrNOAA NOMADSFiltered GRIB ingredients, CONUS/native domains
GFSgfs, noaa-gfsNOAA NOMADSFiltered 0.25 degree global GRIB ingredients
GEFSgefs, noaa-gefsNOAA NOMADSEnsemble member support, defaults to p01 in CLI
RAPrap, noaa-rapNOAA NOMADSFiltered regional GRIB ingredients
NAMnam, noaa-namNOAA NOMADSUses current awphys filtered GRIB files
NBMnbm, noaa-nbmNOAA NOMADSUses current core blend filtered GRIB files
GDPSgdps, cmc-gdpsMSC DatamartDirect GRIB2 field files from Environment Canada
HREFhref, noaa-hrefNOAA NOMADSHREF CONUS ensemble products via filter_hrefconus.pl
ICONicon, dwd-iconDWD OpenDataDirect compressed GRIB2 files
RRFSrrfs, noaa-rrfsNOAA RRFS AWS bucketPublic prototype/direct GRIB2 files
ECMWFecmwf, euroECMWF Open DataDirect IFS 0.25 degree GRIB2 files

NOAA NOMADS connectors use server-side GRIB filtering where available. Direct-file sources such as ECMWF, ICON, GDPS, and RRFS download source files directly; region selection is still used for plot/domain metadata and cache identity.

Radar, Satellite, Observations, and General Data

ConnectorAliasesSourceOutput
GOESgoes, satelliteNOAA public S3 bucketsNetCDF/HDF5 satellite files
NEXRADnexrad, radarUnidata NEXRAD Level II S3 bucketRadar volume files
SPC Storm Reportsspc, reports, stormsNOAA SPCCSV storm reports
METARmetar, weatherAviationWeather.govJSON METAR reports
USGS Earthquakesusgs, quakesUSGS FDSN event APIGeoJSON earthquake catalog
OpenStreetMaposm, map, openstreetmapOverpass APIJSON POI extracts

Region Selection

Model connectors expose only region presets that make sense for their source.

Global models commonly include:

  • global
  • north_america
  • conus
  • europe
  • western_pacific
  • philippines
  • tropics

CONUS/regional models commonly include:

  • native
  • conus
  • northeast
  • southeast
  • central
  • west
  • california

Use:

openfetch fetch gfs sfc_tmp_2m --region philippines
openfetch fetch hrrr sbcape --region southeast

Cache

OpenFetch stores cache metadata in:

~/.openfetch/openfetch.db

Downloaded files are stored in:

~/.openfetch/cache/

Commands:

openfetch cache list
openfetch cache clear
openfetch cache clear --connector metar

Local API Server

Start the local API:

openfetch serve

Open:

http://127.0.0.1:8000/docs

Useful endpoints:

  • GET /connectors
  • GET /connectors/{name}
  • POST /fetch/{connector_name}
  • GET /cache
  • DELETE /cache

Development

Run the test suite and linter:

python -m pytest
python -m ruff check .

Check the npm package contents:

npm pack --dry-run

The package dry run should produce an openfetch-cli-0.1.0.tgz preview without writing a tracked tarball.

License

OpenFetch is licensed under the MIT License. See LICENSE.

About

A local-first terminal application, command-line interface, and API for discovering, previewing, and downloading public weather, radar, observational, geospatial, and earthquake datasets from multiple data providers.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages