Developer API#

The high-level Python API for fetching data in a single line of code.

fetchez.api#

High-level Python Interface for Fetchez.

Usage:

import fetchez

# Search fetchez.search(“bathymetry”)

# Get Data (Returns list of local file paths) files = fetchez.get(“nos_hydro”, region=[-120, -118, 33, 34], year=2020)

# Advanced (With Hooks) files = fetchez.get(“blue_topo”, hooks=[‘unzip’, ‘filter:match=.tif’])

fetchez.api.search(term=None)[source]#

Search available modules by tag, description, or name.

Parameters:

term (str | None, default: None)

Return type:

Dict[Any, Any]

fetchez.api.get(module, region=None, outdir=None, threads=4, hooks=None, **kwargs)[source]#

Fetch data from a module in one line.

Parameters:
  • module (str) – Module name (e.g., ‘nos_hydro’, ‘tnm’).

  • region (List[float] | str | None, default: None) – [W, E, S, N] or ‘loc:Boulder’.

  • outdir (str | None, default: None) – Where to save files (default: ./<module>).

  • threads (int, default: 4) – Parallel download threads.

  • hooks (List[str] | None, default: None) – List of hook strings (e.g. [‘unzip’, ‘audit’]).

  • **kwargs – Arguments passed directly to the module (year=…, datatype=…).

Returns:

List[str] – A list of absolute paths to the downloaded files.