Skip to main content

Geo-Spatial Data Fetching

Project description

Fetchez

🐄🌍 [ F E T C H E Z ] 🌍🐄

The Generic Geospatial Data Acquisition and Registry Engine

Version License Python

Fetchez is a lightweight, modular Python library and command-line tool designed to discover and retrieve geospatial data from a wide variety of public repositories.

Originally part of the CUDEM project, Fetchez is now a standalone tool capable of retrieving Bathymetry, Topography, Imagery, and Oceanographic data (and more!) from sources like NOAA, USGS, NASA, and the European Space Agency.


🌎 Features

  • One command to fetch data from 40+ different sources (SRTM, GMRT, NOAA NOS, USGS 3DEP, Copernicus, etc.).
  • Built-in metadata registry allows you to search for datasets by tag, agency, resolution, or license.
  • Built-in "Fetchez Remote Elevation Datalist" (FRED) automatically indexes remote files for spatial querying without hitting APIs repeatedly.
  • Built-in download engine with automatic retries, timeout handling, and byte-range support for resuming interrupted downloads.
  • Minimal dependencies (requests, tqdm, lxml). Optional shapely support for precise spatial filtering.
  • Supports user-defined plugins via ~/.fetchez/plugins/.

📦 Installation

From Pip

Download and install git (If you have not already): git installation

pip install git+https://github.com/ciresdem/fetchez.git#egg=fetchez

From Source:

git clone https://github.com/ciresdem/fetchez.git
cd fetchez
pip install .

💻 CLI Usage

The primary command is fetchez.

Basic Syntax

fetchez -R <region> <module> [options]

Examples

  • Fetch SRTM+ Data for a Bounding Box
# Region Format: West/East/South/North
fetchez -R -105.5/-104.5/39.5/40.5 srtm_plus
  • Discover Data Sources
# View detailed metadata card for a module
fetchez --info gmrt
  • Fetch Data Using a Place Name
# Automatically resolves "Boulder, CO" to a bounding box region
fetchez -R loc:"Boulder, CO" copernicus --datatype=1
  • List Available Modules
fetchez --modules

🐍 Python API

Fetchez is designed to be easily integrated into Python workflows.

Simple Fetching

import fetchez

# Define a region (West, East, South, North)
bbox = (-105.5, -104.5, 39.5, 40.5)

# Initialize a specific fetcher module
# Use the registry to load modules dynamically
SRTM = fetchez.registry.FetchezRegistry.load_module('srtm_plus')

# Configure and Run
fetcher = SRTM(src_region=bbox, verbose=True)
fetcher.run()

# Access Results (Metadata)
for result in fetcher.results:
    print(f"Downloaded: {result['dst_fn']}")
    print(f"Source URL: {result['url']}")

Data Discovery

Query the registry to find datasets that match your criteria programmatically.

from fetchez.registry import FetchezRegistry

# Search for global bathymetry datasets
matches = FetchezRegistry.search_modules('bathymetry')
print(f"Found modules: {matches}")

# Get details for a specific module
meta = FetchezRegistry.get_info('copernicus')
print(f"Resolution: {meta.get('resolution')}")
print(f"License: {meta.get('license')}")

For modules that rely on file lists (like Copernicus or NCEI), you can interact directly with the local index.

from fetchez import fred

# Load the local index
index = fred.FRED(name='copernicus')

# Search for datasets in a region
results = index.search(
    region=(-10, 10, 40, 50),
    where=["DataType = '3'"] # Filter for COP-10 (European) data
)

print(f"Found {len(results)} datasets.")

🗺️ Supported Data Sources

Fetchez supports over 40 modules categorized by data type. Run fetchez --modules to see the full list.

Category Example Modules
Topography srtm_plus, copernicus, nasadem, tnm (USGS), arcticdem
Bathymetry gmrt, emodnet, gebco, multibeam, nos_hydro
Oceanography tides, buoys, mur_sst
Reference osm (OpenStreetMap), vdatum
Generic http (Direct URL), earthdata (NASA)

🐄 Plugins & Extensions

Need to fetch data from a specialized local server, a private S3 bucket, or a niche API? You don't need to fork the repo!

Fetchez supports user-defined plugins. Drop a Fetchez compatible Python script into your configuration folder, and it will be automatically registered as a command.

Quick Start:

  1. Create the folder: mkdir ~/.fetchez/plugins
  2. Drop a python script there (e.g., my_data.py).
  3. Run it: fetchez my_data

See CONTRIBUTING.md for a full code example.

🛠️ Contributing

We welcome contributions! Please see CONTRIBUTING.md for details on how to register new modules with our metadata schema.

⚠️ Disclaimer on Data Persistence

We provide the tools to locate and download data from authoritative public repositories, but we do not host the data ourselves.

Government agencies reorganize websites, migrate APIs (e.g., WCS 1.0 to 2.0), or decommission servers without notice. A module that fetches perfectly today may encounter a 404 tomorrow.

Source datasets are frequently updated, reprocessed, or removed by their custodians. The "best available" data for a region can change overnight.

Remote servers (like NOAA NCEI, USGS, or Copernicus) may experience downtime, throttling, or rate limits that are entirely outside our control.

We strive to keep our modules robust and our index fresh. If you encounter a broken fetch or a changed endpoint, please open an issue. This helps the whole community keep up with the changes!

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2010-2026 Regents of the University of Colorado

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fetchez-0.2.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fetchez-0.2.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file fetchez-0.2.0.tar.gz.

File metadata

  • Download URL: fetchez-0.2.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fetchez-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f067c102e9b18cae1de0c6051bf5fb64644c1607f8179513ec8f26458f64e882
MD5 2e721c3f0031008d943235f316cabf6d
BLAKE2b-256 7f916273ada26b173cea4a1262f2006434b452156362834cdb35a2f8a58abeae

See more details on using hashes here.

Provenance

The following attestation bundles were made for fetchez-0.2.0.tar.gz:

Publisher: publish.yaml on ciresdem/fetchez

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fetchez-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fetchez-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fetchez-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa76ad7213bfc5948838eddc1bdf35c154c3a75a3ac71df2d87885af86b3211b
MD5 6c5232ef94ce6c3e72f2935061d1e402
BLAKE2b-256 8de24b58bc2808b1497144a04d8af93da9a77b42a409810ad2763c0eed96d2f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for fetchez-0.2.0-py3-none-any.whl:

Publisher: publish.yaml on ciresdem/fetchez

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page