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("charts", region=[-120, -118, 33, 34], hooks=['unzip', 'filename_filter:match=.000'])
fetchez.api.list_modules()[source]#
Return type:

Dict[str, Any]

fetchez.api.list_hooks()[source]#
Return type:

Dict[str, Any]

fetchez.api.search_hooks(term)[source]#
Return type:

Dict[str, Any]

fetchez.api.list_recipes()[source]#
Return type:

Dict[str, Any]

fetchez.api.list_schemas()[source]#
Return type:

Dict[str, Any]

fetchez.api.list_presets()[source]#
Return type:

Dict[str, Any]

fetchez.api.list_profiles()[source]#
Return type:

Dict[str, Any]

fetchez.api.search_profiles(term)[source]#
Return type:

Dict[str, Any]

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

Search across ALL Fetchez registries simultaneously.

Parameters:

term (str)

Return type:

Dict[str, Dict[str, 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 (Union[List[float], str, None], default: None) – [W, E, S, N] or ‘loc:Boulder’.

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

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

  • hooks (Optional[List[str]], 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.

fetchez.api.run_recipe(target, region=None)[source]#

Execute a YAML recipe.

‘target’ can be a local file path or the name of a registered recipe.

Parameters:
Return type:

bool