Metadata-Version: 2.4
Name: pygeofetch
Version: 2.7.3.5
Summary: Universal satellite data pipeline + geospatial processing platform
Author-email: Samuel Appiah Kubi <appiahkubis14@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Samuel Appiah Kubi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://www.eocoreint.com/
Project-URL: Documentation, https://pygeofetch.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/EOCoreINT/pygeofetch
Project-URL: Bug Tracker, https://github.com/EOCoreINT/pygeofetch/issues
Keywords: satellite,remote-sensing,GIS,earth-observation,geospatial,SAR,Sentinel,Landsat
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic
Requires-Dist: rich
Requires-Dist: click>=8.1
Requires-Dist: pydantic>=2.5
Requires-Dist: pydantic-settings>=2.1
Requires-Dist: PyYAML>=6.0
Requires-Dist: cryptography>=42.0
Requires-Dist: keyring>=24.3
Requires-Dist: tenacity>=8.2
Requires-Dist: python-dateutil>=2.9
Requires-Dist: requests>=2.31
Requires-Dist: anyio>=4.2
Requires-Dist: numpy>=1.26
Requires-Dist: tqdm>=4.66
Requires-Dist: eval_type_backport>=0.2; python_version < "3.10"
Provides-Extra: geo
Requires-Dist: rasterio>=1.3; extra == "geo"
Requires-Dist: geopandas>=0.14; extra == "geo"
Requires-Dist: pyarrow>=15.0; extra == "geo"
Requires-Dist: shapely>=2.0; extra == "geo"
Requires-Dist: pyproj>=3.6; extra == "geo"
Provides-Extra: processor
Requires-Dist: rasterio>=1.3; extra == "processor"
Requires-Dist: rioxarray>=0.15; extra == "processor"
Requires-Dist: xarray>=2024.1; extra == "processor"
Requires-Dist: eoreader>=0.24; extra == "processor"
Requires-Dist: spyndex>=0.5; extra == "processor"
Requires-Dist: scipy>=1.12; extra == "processor"
Requires-Dist: scikit-image>=0.23; extra == "processor"
Requires-Dist: geopandas>=0.14; extra == "processor"
Provides-Extra: sar
Requires-Dist: sarxarray>=0.1; extra == "sar"
Provides-Extra: insar
Requires-Dist: scipy>=1.12; extra == "insar"
Requires-Dist: shapely>=2.0; extra == "insar"
Requires-Dist: xarray>=2024.1; extra == "insar"
Provides-Extra: ost
Requires-Dist: opensartoolkit>=0.12.1; extra == "ost"
Provides-Extra: viz
Requires-Dist: leafmap>=0.30; extra == "viz"
Requires-Dist: folium>=0.16; extra == "viz"
Requires-Dist: matplotlib>=3.7; extra == "viz"
Requires-Dist: localtileserver>=1.0.0; extra == "viz"
Requires-Dist: ipysheet>=0.6.0; extra == "viz"
Requires-Dist: ipyleaflet>=0.17.0; extra == "viz"
Requires-Dist: ipywidgets>=8.0.0; extra == "viz"
Requires-Dist: ipyevents>=2.0.2; extra == "viz"
Requires-Dist: ipyfilechooser>=0.6.0; extra == "viz"
Requires-Dist: sidecar>=0.5.0; extra == "viz"
Requires-Dist: bokeh>=3.0.0; extra == "viz"
Requires-Dist: seaborn>=0.12.0; extra == "viz"
Requires-Dist: plotly>=5.14.0; extra == "viz"
Requires-Dist: whitebox>=2.3.0; extra == "viz"
Requires-Dist: whiteboxgui>=2.2.0; extra == "viz"
Requires-Dist: geemap>=0.28.0; extra == "viz"
Requires-Dist: osmnx>=1.9.4; extra == "viz"
Requires-Dist: contextily>=1.6.0; extra == "viz"
Requires-Dist: xyzservices>=2023.10.0; extra == "viz"
Requires-Dist: mapclassify>=2.6.0; extra == "viz"
Requires-Dist: geoplot>=0.5.0; extra == "viz"
Requires-Dist: mplleaflet>=0.0.5; extra == "viz"
Requires-Dist: branca>=0.6.0; extra == "viz"
Requires-Dist: plotly-geo>=1.0.0; extra == "viz"
Requires-Dist: streamlit>=1.28.0; extra == "viz"
Requires-Dist: pyvista; extra == "viz"
Provides-Extra: viz-3d
Requires-Dist: keplergl>=0.3.0; extra == "viz-3d"
Provides-Extra: cloud
Requires-Dist: boto3>=1.34; extra == "cloud"
Requires-Dist: pystac>=1.9; extra == "cloud"
Requires-Dist: planetary-computer>=1.0; extra == "cloud"
Provides-Extra: notebook
Requires-Dist: ipython>=8.0; extra == "notebook"
Requires-Dist: ipywidgets>=8.0; extra == "notebook"
Requires-Dist: jupyter>=1.0; extra == "notebook"
Provides-Extra: schedule
Requires-Dist: croniter>=2.0; extra == "schedule"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: pytest-mock>=3.12; extra == "dev"
Requires-Dist: ruff>=0.3; extra == "dev"
Requires-Dist: black<25.0,>=24.0; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pygeofetch[cloud,dev,geo,insar]; extra == "test"
Provides-Extra: insar-full
Requires-Dist: snaphu>=0.1; extra == "insar-full"
Requires-Dist: scipy>=1.12; extra == "insar-full"
Provides-Extra: full
Requires-Dist: pygeofetch[cloud,geo,insar,notebook,processor,schedule,viz]; extra == "full"
Provides-Extra: all
Requires-Dist: pygeofetch[full]; extra == "all"
Dynamic: license-file

<div align="center">

# pygeofetch

**Search, check, download and process satellite data from many providers, with one Python API and one CLI.**

[![PyPI version](https://badge.fury.io/py/pygeofetch.svg)](https://pypi.org/project/pygeofetch/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pygeofetch.svg)](https://pypi.org/project/pygeofetch/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22087230.svg)](https://doi.org/10.5281/zenodo.22087230)
[![Tests](https://github.com/EOCoreINT/pygeofetch/actions/workflows/tests.yml/badge.svg)](https://github.com/EOCoreINT/pygeofetch/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/appiahkubis14/pygeofetch/graph/badge.svg?token=2PS2A2VZL6)](https://codecov.io/gh/appiahkubis14/pygeofetch)

[Statement of need](#statement-of-need) · [Install](#installation) · [Quick start](#quick-start) · [Case study](#case-study-portuguese-bend-landslide-palos-verdes) · [Documentation](https://pygeofetch.readthedocs.io/en/latest/)

</div>

---

## Statement of need

Earth observation data are spread across many archives. Copernicus, USGS, NASA, ASF, OpenTopography and the commercial providers each have their own login, query interface and file format. Before any analysis, a researcher has to learn each of them, and the most expensive mistakes are found only after downloading: a Sentinel-1 stack mixing tracks or missing part of the area, a date with several overlapping slices, an optical scene too cloudy to use. For radar time series these mistakes cost hundreds of gigabytes and days of processing.

Existing tools solve parts of this. Clients such as EODAG, pystac-client and asf_search unify search and download; processors such as SNAP, ISCE2, MintPy and ASF HyP3 process data once suitable inputs are in hand. Getting from an area of interest to a consistent, complete set of inputs, and then to a first result, is still left to the user's own scripts.

pygeofetch covers that path in one pip-installable Python package:

- **One search across providers**, returning STAC-style results with footprint geometry where the provider supplies it.
- **Checks before download**: AOI coverage, one track and one product per date for Sentinel-1 stacks, temporal network connectivity, burst compatibility and cloud cover. Each check reports what it removed and why.
- **Reliable transfer**: parallel, resumable and checksum-verified downloads, with optional clean-up of inputs once they have been processed.
- **Native processing in Python**: optical preprocessing and spectral indices, and a Sentinel-1 InSAR chain (orbits, DEM, coregistration with ESD, interferograms, unwrapping with SNAPHU, SBAS time series) that needs no SNAP or ISCE installation.

It is meant for researchers, students and small teams who need analysis-ready stacks from several archives without maintaining a separate script for each provider.

---

## Installation

```bash
pip install pygeofetch                 # core: search and download
pip install "pygeofetch[geo]"          # + rasterio, geopandas, shapely
pip install "pygeofetch[insar]"        # + InSAR processing and SBAS time series
pip install "pygeofetch[insar-full]"   # + extra InSAR tools (Linux)
pip install "pygeofetch[all]"          # everything
```

Requires Python 3.10 or later. Run `pygeofetch doctor` to check your installation and provider connections.

---

## Quick start

```python
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="...")  # stored once, on your machine

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")
```

A consistent Sentinel-1 stack for InSAR, in one call:

```python
from pygeofetch.insar import search_and_select_consistent_stack

aoi = BoundingBox(min_lon=18.40, min_lat=50.05, max_lon=18.80, max_lat=50.25)
scenes, report = search_and_select_consistent_stack(client, aoi, start_date="2017-04-01", end_date="2017-12-31")
print(report)  # chosen track, dates kept, and what was dropped and why
```

Everything is also available from the CLI (`pygeofetch search run ...`, `pygeofetch download run ...`) and as YAML pipelines.

---

## Case study: Portuguese Bend landslide, Palos Verdes

**Notebook, figures and results:** [github.com/appiahkubis14/palos-verdes-landslide-cs](https://github.com/appiahkubis14/palos-verdes-landslide-cs)

The Portuguese Bend landslide complex in Rancho Palos Verdes, California, moved more than a metre a year in 2026. One notebook follows it from search to a check against GPS, using pygeofetch alone.

<p align="center"><img src="https://raw.githubusercontent.com/appiahkubis14/palos-verdes-landslide-cs/main/figures/share_four_views.png" width="85%" alt="One interferogram per geometry: Sentinel-1 ascending and descending, NISAR ascending and descending"></p>
<p align="center"><em>One interferogram per geometry from the same weeks. Sentinel-1 formed by pygeofetch from SLCs; NISAR GUNW products found and fetched at ASF.</em></p>

**What pygeofetch did:**

1. **Search.** It found 63 NISAR L2 GUNW products at ASF in 0.9 s and 83 Sentinel-1 SLC products at the Copernicus Data Space in 2.4 s, matched them with the 31 scenes already on disk, and downloaded none of them again.
2. **Inputs.** It fetched precise orbits for all 31 dates and the Copernicus 30 m DEM.
3. **Interferograms.** It formed 34 ascending and 26 descending Sentinel-1 interferograms natively and put all four geometries on one map grid.
4. **Time series.** The slide moves faster than a 12-day C-band pair can follow (about 0.4 m/yr in the line of sight), but within NISAR's L-band limit (about 1.8 m/yr), so displacement was built from NISAR's unwrapped phase with pygeofetch's SBAS solver.

**Result.** A moving area of 2.44 km² was found from the data, with typical line-of-sight rates of −0.46 m/yr (ascending) and −0.27 m/yr (descending). Against the city's monthly GPS surveys, projected into each line of sight:

| | GPS points | correlation r | RMS difference | slope NISAR / GPS |
|---|---|---|---|---|
| NISAR ascending | 101 | 0.92 | 0.12 m/yr | 1.00 |
| NISAR descending | 101 | 0.79 | 0.17 m/yr | 1.12 |

<p align="center"><img src="https://raw.githubusercontent.com/appiahkubis14/palos-verdes-landslide-cs/main/figures/share_gps_scatter.png" width="55%" alt="NISAR line-of-sight rate against GPS projected into the line of sight"></p>

Rates are along each radar's line of sight, relative to a stable ridge. The notebook lists its limits: NISAR products before 21 October 2026 are provisional, and the GPS predictions use horizontal motion where the workbook gives no vertical.

---

## Providers

22 providers. Open access without login includes `planetary_computer`, `aws_earth`, `element84`, `noaa_big_data`, `jaxa_earth`, and `geoserver_generic` for any OGC WMS/WFS/WCS endpoint. With an account: USGS, Copernicus Data Space, NASA Earthdata (and Earthdata Cloud), Alaska Satellite Facility, OpenTopography, Planet, Sentinel Hub, Maxar, Airbus OneAtlas and Earth Explorer.

`pygeofetch providers list` shows the current table and `pygeofetch providers info PROVIDER` the details of one, including whether it returns real footprint geometry or only a bounding box.

Credentials are stored in a Fernet-encrypted local file by default, or in the system keyring (Keychain, Credential Manager, Secret Service) if you choose.

---

## Processing

| Area | Functions |
|---|---|
| **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`) | `search_and_select_consistent_stack` · `SLCExtractor` · `InterferogramGenerator` · `AtmosphericCorrector` · `IonosphericCorrector` · `PhaseUnwrapper` (SNAPHU) · `SBASTimeSeries` · `InSARProject` |

Signatures and options: [documentation](https://pygeofetch.readthedocs.io/en/latest/) and [`pygeofetch/insar/README.md`](pygeofetch/insar/README.md).

---

## YAML pipelines

```yaml
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}
```

```bash
pygeofetch proc-pipeline run weekly-sentinel2.yaml --input scene.tif
pygeofetch pipeline schedule weekly-sentinel2.yaml --name ndvi-weekly
```

Built-in templates: `ndvi` · `change_detection` · `flood_map` · `urban_mapping` · `sar_analysis` · `land_cover`.

---

## CLI

| Group | Example | Purpose |
|---|---|---|
| `auth` | `pygeofetch auth add copernicus --username U --password P` | Manage credentials |
| `providers` | `pygeofetch providers list --capabilities sar` | Discover and inspect providers |
| `search` | `pygeofetch search run --bbox "..." --providers aws_earth,copernicus` | Search across providers |
| `download` | `pygeofetch download run --from-search results.geojson --parallel 4` | Parallel, resumable downloads |
| `preprocess` | `pygeofetch preprocess clip scene.tif --bbox "..."` | Correction, clipping, reprojection |
| `index` | `pygeofetch index ndvi --red B04.tif --nir B08.tif` | Spectral indices |
| `post` | `pygeofetch post cog scene.tif --compress deflate` | Vectorizing, zonal statistics, COG |
| `sar` | `pygeofetch sar coherence slc1.tif slc2.tif` | Despeckling, calibration, coherence, flood maps |
| `proc-pipeline` / `pipeline` | `pygeofetch pipeline schedule weekly.yaml` | Run and schedule YAML pipelines |
| `cache` / `config` | `pygeofetch cache prune --max-size 1GB` | Cache and configuration |

`pygeofetch --help`, or `--help` on any command, gives the full option list.

---

## Citation

```bibtex
@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.7.3.5},
  doi       = {10.5281/zenodo.22087230},
  url       = {https://doi.org/10.5281/zenodo.22087230}
}
```

## Documentation

[pygeofetch.readthedocs.io](https://pygeofetch.readthedocs.io/en/latest/): CLI reference, provider login guides, pipeline configuration, processing catalogue and InSAR methods.

## Contributing

Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). Good first issues: real footprint geometry for providers that return only a bounding box, completing stub providers, and new post-processing actions.

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

## Support

pygeofetch is developed and maintained by one person. If it is useful in your research or organisation, [sponsoring it on GitHub](https://github.com/sponsors/appiahkubis14) funds the time spent keeping provider integrations working as their APIs change.

## License

MIT, see [LICENSE](LICENSE). © 2026 Samuel Appiah Kubi.
