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.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.