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'])
- copyright:
2010-2026 Regents of the University of Colorado
- license:
MIT, see LICENSE for more details.
-
fetchez.api.list_modules()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_modules(term)[source]
- Return type:
Dict[str, Any]
-
fetchez.api.list_bundles()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_bundles(term)[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.search_recipes(term)[source]
- Return type:
Dict[str, Any]
-
fetchez.api.list_schemas()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_schemas(term)[source]
- Return type:
Dict[str, Any]
-
fetchez.api.list_modifiers()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_modifiers(term)[source]
- Return type:
Dict[str, Any]
-
fetchez.api.list_presets()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_presets(term)[source]
- Return type:
Dict[str, Any]
-
fetchez.api.list_streams()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_streams(term)[source]
- Return type:
Dict[str, Any]
-
fetchez.api.list_readers()[source]
- Return type:
Dict[str, Any]
-
fetchez.api.search_readers(term)[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, region_srs='EPSG:4326', outdir=None, threads=4, hooks=None, dry_run=False, verbose=True, ignore_failures=False, **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’.
region_srs (Optional[str], default: 'EPSG:4326') – The srs of the region (defalt: EPSG:4326).
outdir (Union[str, Path, None], 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’]).
dry_run (bool, default: False) – Don’t download any data.
verbose (bool, default: True) – Run in verbose mode.
ignore_failures (bool, default: False) – Ignore exceptions and push through.
**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, region_srs='EPSG:4326', modifiers=None, schemas=None, ignore_failures=False)[source]
Execute a YAML recipe.
‘target’ can be a local file path or the name of a registered recipe.
- Parameters:
-
- Return type:
bool
-
class fetchez.api.Pipeline(sources, region=None, **kwargs)[source]
Bases: object
A Builder class for orchestrating Fetchez workflows via the Recipe engine.
-
__init__(sources, region=None, **kwargs)[source]
-
modifier(**kwargs)[source]
-
schema(**kwargs)[source]
-
hook(hook_or_string, **kwargs)[source]
Chain a global hook definition to the pipeline.
-
execute(threads=4, shared_cache=None, ignore_failures=False, refresh=False)[source]
Execute the configured pipeline through the Recipe engine.
-
fetchez.api.read(sources, region=None, shared_cache=None, **kwargs)[source]
Initializes a Fetchez stream.