Skip to main content

PyPI version Python Versions License: MIT DOI Tests codecov Sponsor

A unified satellite data and geospatial processing platform — one CLI, one Python API, 22 verified providers, and a fully verified InSAR chain.

Quick Start · Mexico City Case Study · Case Study Repo ↗ · Documentation · Notebooks


Overview

pygeofetch is a production-ready framework for acquiring and processing Earth observation data. It provides authenticated, unified access to 22 verified satellite providers — Sentinel, Landsat, Planet, Maxar, Airbus, Copernicus, USGS, NASA, JAXA, and more — through a single CLI and Python API, and layers a complete geospatial processing engine on top.

Where pygeofetch goes further than most data-access libraries is in its InSAR chain: burst-aware coregistration, real flat-earth and topographic phase removal, ERA5 tropospheric and ionospheric correction, phase unwrapping, and SBAS time-series inversion — each stage independently verified against synthetic ground truth or real, published deformation studies, not assumed correct from theory alone. The Mexico City case study below walks through that chain end to end on real Sentinel-1 data.

Core capabilities:

Authenticated access 22 verified providers; credentials stored via a Fernet-encrypted local file by default, or the system keyring (Keychain / Credential Manager / Secret Service) as an opt-in alternative
Federated search One query across all providers → STAC 1.0 GeoJSON / GeoParquet / CSV, with real footprint geometry where the provider supplies it
Resilient downloads Parallel, resumable, checksum-verified, band-selective, atomic writes
Preprocessing Atmospheric correction, cloud masking, reprojection, resampling, pan-sharpening, mosaicking
17 spectral indices NDVI, EVI, SAVI, NDWI, MNDWI, NDBI, LST, Albedo, dNBR, GLCM texture, and more
Verified InSAR chain Coregistration → phase removal → atmospheric/ionospheric correction → unwrapping → SBAS inversion
YAML pipelines Chainable, schedulable, repeatable workflows with full run history

NDVI trend (2018–2024) and severity classification for the Obuasi Municipal District, Ghana — computed end-to-end with pygeofetch from boundary-clipped USGS Landsat data.

Across 2018–2024, 32.0% of the district shows measurable vegetation decline (9.2% strong, 22.8% moderate), against 57.5% stable and 10.5% increasing. The decline is spatially concentrated west of −1.70° longitude, consistent with the district's documented small-scale mining activity — though an NDVI trend alone can't isolate cause from correlated signals like logging or agricultural clearing without ground verification. The eastern two-thirds of the district is overwhelmingly stable, which is itself informative: it suggests a localized driver rather than a district-wide seasonal artifact.


Why pygeofetch

Satellite data access is fragmented — every provider has its own auth scheme, query API, and file format, and most tools that unify search stop well short of processing. pygeofetch is the only package that combines broad provider coverage with a full processing engine and a genuinely verified InSAR chain in one place.

Feature pygeofetch EODAG pystac-client satpy sentinelsat
Providers 22 10+ STAC only Limited Sentinel only
Processing engine ✅ Full ❌ ❌ Partial ❌
Spectral indices ✅ 17+ ❌ ❌ ❌ ❌
Full InSAR chain ✅ Verified ❌ ❌ ❌ ❌
Real footprint geometry ✅ ❌ ✅ (STAC only) ❌ ❌
YAML pipelines + scheduling ✅ ❌ ❌ ❌ ❌
Commercial providers ✅ Planet/Maxar ❌ ❌ ❌ ❌

Providers

22 verified providers total. Open-access, no login required — including planetary_computer, aws_earth, element84, noaa_big_data, jaxa_earth, and geoserver_generic for any OGC WMS/WFS/WCS endpoint.

Authenticated — USGS, Copernicus CDSE, NASA Earthdata (+ Cloud), Alaska SAR Facility, OpenTopography, Planet Labs, Sentinel Hub, Maxar GBDX, Airbus OneAtlas, and Earth Explorer.

Every provider has been directly verified to return at minimum a correct bounding box; several are further confirmed to return real, precise footprint geometry against a live API response (marked in pygeofetch providers info PROVIDER). Run pygeofetch providers list for the full, current table.


Installation

pip install pygeofetch                 # core — free providers work immediately
pip install "pygeofetch[geo]"          # + rasterio, geopandas, shapely
pip install "pygeofetch[insar]"        # + native SBAS inversion, phase unwrapping
pip install "pygeofetch[insar-full]"   # + For Linux Users
pip install "pygeofetch[all]"          # everything

Requires Python 3.9+. Run pygeofetch doctor to verify your install and provider connectivity.


⚡ Quick Start

from pygeofetch import PyGeoFetch
from pygeofetch.models.search_query import SearchQuery, BoundingBox
from pygeofetch.models.download_task import DownloadOptions

client = PyGeoFetch()
client.add_credentials("copernicus", username="you@example.com", password="...")

results = client.search(
    SearchQuery(bbox=BoundingBox.from_string("-74.1,40.6,-73.7,40.9"),
                start_date="2024-01-01", cloud_cover_max=20),
    providers=["copernicus", "planetary_computer", "aws_earth"],
)

downloads = client.download(results[:5], destination="./data/",
                             options=DownloadOptions(parallel=4, bands=["B02", "B03", "B04"]))

ndvi = client.indices.ndvi(red="B04.tif", nir="B08.tif")

The equivalent is available as a CLI (pygeofetch search run ... / pygeofetch download run ...) and as chainable, schedulable YAML pipelines — see the full CLI reference and notebooks.


🌐 Case Study: Mapping Mexico City Land Subsidence with InSAR

Full project, notebook, and data: github.com/EOCoreINT/mexico-subsidence-project

Mexico City sits on a drained lakebed and is subsiding at some of the fastest rates on Earth as its aquifer is depleted. It's a demanding, real-world test for an InSAR chain: a huge, largely incoherent urban scene, a fragmented acquisition history, and a deformation signal large enough to make phase unwrapping genuinely hard. What follows is a condensed walkthrough of the full project above — the pygeofetch InSAR chain run end to end against real Sentinel-1 data over Iztapalapa, no synthetic shortcuts. For the complete methodology, every intermediate number, and an unusually candid validation discussion, read the project README itself.

1. Authenticated federated search. client.search() against Copernicus Data Space for SLC scenes over the city (bbox -99.183, 19.278, -99.003, 19.438, July 2016 – September 2017) returns a stack of Sentinel-1A/1B candidates in seconds, filterable straight down to a single consistent track.

Results carry real footprint geometry and drop straight onto a map via MapViewer, with hover info for scene ID, date, satellite, and provider — useful for spotting swath overlap before committing to a download.

2. DEM acquisition. A matching search against OpenTopography returns seven DEM products for the AOI; pygeofetch downloads and clips the selected one (SRTM 30 m) automatically for topographic phase removal.

3. Preflight validation. Before anything downloads, the PreflightGate checks search truncation, AOI coverage, temporal network connectivity, and burst-timing family compatibility from lightweight annotation XMLs — catching acquisitions that would waste compute before they cost bandwidth. This run avoided roughly 360 GB of downloads by excluding 48 of 115 candidate scenes at this stage alone.

Real orbit state vectors then pre-filter the candidate pair list against Sentinel-1's own mission thresholds, rejecting pairs for excess burst-sync error, temporal baseline, or spatial baseline before any interferogram is attempted.

4. Interferogram formation. Of 2,211 theoretically possible pairs across 67 downloaded scenes, real orbit-based coregistration, per-burst Enhanced Spectral Diversity, deburst, and flat-earth/topographic phase removal reduce that to 78 valid pairs — the dense urban fringe pattern below is raw wrapped phase, before any correction.

5. Coherence. Amplitude and coherence are estimated together for every pair; the urban core holds noticeably higher coherence (0.614) than the scene-wide average (0.508) — exactly the contrast expected between stable built structures and vegetated or agricultural surrounds.

6. Phase unwrapping. SNAPHU (Chen & Zebker, 2001) resolves each wrapped interferogram into continuous phase, both as a raw array and reprojected onto the real city footprint. Reliable coverage is intentionally sparse (~0.1–0.2%) — dense vegetation cover means most of the scene decorrelates between 18–24 day passes, so the pipeline marks those pixels NaN rather than interpolating across them.

7. SBAS time-series inversion. The full 58-date descending stack, once low-coherence and unreliable-reference-pixel pairs are excluded, fractures into 17 disconnected network "islands" — a genuine finding about this AOI's data quality, not a bug. The largest connected island (10 dates, 11 pairs) carries the final inversion, referenced near Cerro de la Estrella.

The resulting velocity field, uncertainty map, reliability mask, and displacement time series recover a 2nd–98th-percentile vertical velocity of −35.5 to −2.9 cm/year where reliable pixels exist.

That result is directionally consistent — same sign, same order of magnitude — with the peer-reviewed peak of −39.1 cm/year reported for Iztapalapa by Cigna & Tapete (2021, Remote Sensing of Environment), a study built from 300+ scenes across six years. It is explicitly not a validated replication of that study: this run used a fraction of the data volume, and the project's own README is deliberately careful not to overclaim the comparison — worth reading in full if you want the honest version of what this number does and doesn't prove.

The full, runnable notebook — real search and download throughout, no synthetic substitutions — is mexico_city_full_confirmed (2).ipynb in the mexico-subsidence-project repo; see also piton_fournaise_full.ipynb and amatrice_full.ipynb in notebooks/ for the same chain applied to the 2021 Piton de la Fournaise eruption and the 2016 Amatrice earthquake.


Processing Engine

Preprocessing (client.preprocess): atmos (DOS1/DOS2, Sen2Cor, FLAASH, 6S, iCOR) · cloud_mask · cloud_fill · topo_correct · clip · reproject · resample · pansharpen · tile · mosaic · composite

Spectral indices (client.indices): ndvi · evi · savi · ndwi · mndwi · ndbi · ndsi · ndmi · nbr / dnbr · tct · pca · texture (GLCM) · lst · albedo · band_math

Post-processing (client.post): vectorize → smooth → regularize → zonal_stats → buffer → centroids → compress → cog

SAR (client.sar): despeckle (Lee, Enhanced Lee, Frost, Gamma MAP) · calibrate (σ0/γ0/β0) · flood_map · coherence

InSAR (pygeofetch.insar): SLCExtractor · InterferogramGenerator · AtmosphericCorrector (elevation-correlated or real ERA5) · IonosphericCorrector (real IONEX/CDDIS) · PhaseUnwrapper (SNAPHU) · SBASTimeSeries · DataValidator · InSARProject (high-level, search-to-interferogram wrapper)

Full method signatures and options are in the documentation and pygeofetch/insar/README.md.


YAML Pipelines

name: weekly-sentinel2-ndvi
schedule: "0 6 * * 1"
steps:
  - search: {providers: [copernicus, aws_earth], date_range: last_7_days, cloud_cover: "0-10"}
  - filter: {expression: "data.cloud_cover < 5"}
  - download: {parallel: 4, output: ./raw/, bands: [B04, B08]}
  - ndvi: {red: B04.tif, nir: B08.tif}
  - vectorize: {threshold: 0.3, format: geojson}
  - cog: {compress: deflate}
pygeofetch proc-pipeline run weekly-sentinel2.yaml --input scene.tif
pygeofetch pipeline schedule weekly-sentinel2.yaml --name ndvi-weekly

Six built-in templates ship out of the box: ndvi · change_detection · flood_map · urban_mapping · sar_analysis · land_cover.


CLI Reference

Every capability above is also exposed as a CLI command, grouped by area:

Group Example Purpose
auth pygeofetch auth add copernicus --username U --password P Manage per-provider credentials
providers pygeofetch providers list --capabilities sar Discover and inspect providers
search pygeofetch search run --bbox "..." --providers aws_earth,copernicus Federated search, 7 output formats
download pygeofetch download run --from-search results.geojson --parallel 4 Parallel, resumable downloads
preprocess pygeofetch preprocess clip scene.tif --bbox "..." Atmospheric correction, clipping, reprojection, etc.
index pygeofetch index ndvi --red B04.tif --nir B08.tif Spectral index computation
post pygeofetch post cog scene.tif --compress deflate Vectorization, zonal stats, COG conversion
sar pygeofetch sar coherence slc1.tif slc2.tif Despeckling, calibration, coherence, flood mapping
proc-pipeline / pipeline pygeofetch pipeline schedule weekly.yaml YAML pipeline execution and scheduling
cache / config pygeofetch cache prune --max-size 1GB Cache and configuration management

Run pygeofetch --help or any subcommand with --help for the complete, current option list, or see the CLI reference docs.


📚 Citation

If you use PyGeoFetch in your research or operational work, please cite it using the following:

Software Citation

@software{pygeofetch_2026,
  author       = {Appiah Kubi, Samuel},
  title        = {PyGeoFetch: A Unified Python Framework for Multi-Provider Satellite Data Acquisition, Pre-download Quality Control, and Geospatial Processing},
  year         = {2026},
  publisher    = {Zenodo},
  version      = {2.6.5.0.1},
  doi          = {10.5281/zenodo.22087230},
  url          = {https://doi.org/10.5281/zenodo.22087230}
}

Documentation

Full documentation: https://pygeofetch.readthedocs.io/en/latest/ — CLI reference, provider auth guides, pipeline configuration, post-processing catalogue, and InSAR verification methodology.

Support this project

pygeofetch is built and maintained by a single developer, in the open, alongside a full-time workload — the InSAR/optical fusion chain, the provider verification work, and the documentation are all real, independently-verified engineering, not a side project maintained on autopilot. If pygeofetch is useful to your research or your organization, sponsoring its development directly funds the time spent keeping 22 provider integrations current as their real APIs change, and building out the multi-sensor pipelines documented above.

Sponsor on GitHub

Contributing

Contributions are welcome — see CONTRIBUTING.md. Good first issues include extending real footprint geometry to remaining bbox-only providers, wiring stub providers to full API integrations, and adding new post-processing actions.

git clone git@github.com:EOCoreINT/pygeofetch.git && cd pygeofetch
pip install -e ".[test]" && pytest tests/ -v

License

MIT — see LICENSE. © 2026 Samuel Appiah Kubi.

Metadata

Release files for pygeofetch 2.6.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygeofetch 2.6.5.0
File Size Uploaded Provenance
pygeofetch-2.6.5.0.tar.gz 844.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pygeofetch 2.6.5.0
File Interpreter ABI Platform
pygeofetch-2.6.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / pygeofetch-2.6.5.0.tar.gz

Download URL pygeofetch-2.6.5.0.tar.gz
Size 844.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6ad45c6fa10530851810ef040662e733a7554fa2f0ecb22b3e6812be93f040d7
BLAKE2b-256 checksum
How to use checksums
6b981fe6119cbccce1e0efbd6a2a20567eeec7df4a761e9415ea14da985b2c08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pygeofetch-2.6.5.0-py3-none-any.whl

Download URL pygeofetch-2.6.5.0-py3-none-any.whl
Size 746.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
112660ab3ebfb0b66abbc0d2d399464bec65d56499b209d97ebd61026485534f
BLAKE2b-256 checksum
How to use checksums
e07ad1d9bcdf58661f8da9e702e641f74ccf3fe153d2423c6df6aff6dafcae56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pygeofetch 2.6.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

2.6.5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page