Skip to main content

Native-grid Google Earth Engine downloader with optional alignment-aware Zarr stacking.

Project description

edown

edown is a Google Earth Engine downloader that discovers images for a location and time range, downloads each image in its native grid as GeoTIFF, and can optionally build Zarr stacks for grid-compatible groups.

What It Does

  • Searches an ImageCollection by date range and AOI.
  • Preserves each image's native CRS and transform instead of forcing a common projection.
  • Downloads intersecting chunks in parallel across multiple images.
  • Writes a run manifest with discovery, download, and stack metadata.
  • Builds Zarr outputs only when images share an alignment signature.

Installation

python -m pip install edown

edown supports Python 3.9 through 3.14.

For local development:

python -m pip install -e ".[dev,stack,dask]"

Authentication

edown prefers Earth Engine service-account credentials when both of these environment variables are set:

  • GEE_SERVICE_ACCOUNT
  • GEE_SERVICE_ACCOUNT_KEY

Otherwise it tries, in order:

  • persistent Earth Engine user credentials
  • Google application default credentials

If both user-auth and ADC refresh tokens are stale, reauthenticate before running downloads.

CLI

Search only:

edown search \
  --collection-id COPERNICUS/S2_SR_HARMONIZED \
  --start-date 2024-06-01 \
  --end-date 2024-06-07 \
  --bbox -0.15 51.48 0.02 51.56 \
  --band B4 \
  --band B8 \
  --manifest-path manifests/search.json

Download native-grid GeoTIFFs:

edown download \
  --collection-id COPERNICUS/S2_SR_HARMONIZED \
  --start-date 2024-06-01 \
  --end-date 2024-06-07 \
  --geojson docs/examples/aoi.geojson \
  --band B4 \
  --band B8 \
  --output-root ./data

Build Zarr stacks from compatible groups:

edown stack \
  --manifest-path manifests/run.json \
  --output-root ./data

Run the bundled end-to-end Sentinel-2 example:

python examples/s2_find_download_stack.py --output-root ./data/live-s2

Python API

from pathlib import Path

from edown import AOI, DownloadConfig, download_images

config = DownloadConfig(
    collection_id="COPERNICUS/S2_SR_HARMONIZED",
    start_date="2024-06-01",
    end_date="2024-06-07",
    aoi=AOI.from_bbox((-0.15, 51.48, 0.02, 51.56)),
    bands=("B4", "B8"),
    output_root=Path("data"),
)

summary = download_images(config)
print(summary.manifest_path)

Live Integration Test

The default test suite is mocked and offline. For a real end-to-end Sentinel-2 smoke test, install the stack extras:

python -m pip install -e ".[dev,stack]"

Then run:

export EDOWN_RUN_LIVE_TESTS=1
python -m pytest -s tests/test_live_s2.py

Default live settings:

  • collection: COPERNICUS/S2_SR_HARMONIZED
  • dates: 2024-06-01 through 2024-06-03
  • bbox: -0.1278,51.5072,-0.1270,51.5078
  • bands: B4,B8

You can override them with:

  • EDOWN_LIVE_COLLECTION_ID
  • EDOWN_LIVE_START_DATE
  • EDOWN_LIVE_END_DATE
  • EDOWN_LIVE_BBOX
  • EDOWN_LIVE_BANDS

This requires valid Earth Engine authentication, via either:

  • GEE_SERVICE_ACCOUNT and GEE_SERVICE_ACCOUNT_KEY (path to a service-account JSON key file)
  • existing local Earth Engine credentials
  • valid Google application default credentials

Notes

  • --chunk-size is only used as an exact size when --chunk-size-mode fixed is set.
  • In the default auto mode, edown estimates chunk sizes per image from the AOI window and request byte limits.

Development

  • python -m pytest
  • ruff check .
  • mypy src
  • python -m build

Docs are built with MkDocs Material and published to GitHub Pages from GitHub Actions.

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

edown-0.1.1.tar.gz (217.3 kB view details)

Uploaded Source

Built Distribution

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

edown-0.1.1-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file edown-0.1.1.tar.gz.

File metadata

  • Download URL: edown-0.1.1.tar.gz
  • Upload date:
  • Size: 217.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edown-0.1.1.tar.gz
Algorithm Hash digest
SHA256 004e8fead8ecfd7cbeb375dd28e42808e3ed69d9d5e5ab977ca198cac4fecab5
MD5 e5fa4a16fdfc48b1a033f4fb23802f01
BLAKE2b-256 ba2c2b9d9c65022233eefb91f7632c0c0f94d2484bf58e30bcd9d8d3330dde15

See more details on using hashes here.

Provenance

The following attestation bundles were made for edown-0.1.1.tar.gz:

Publisher: publish.yml on MarcYin/edown

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

File details

Details for the file edown-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: edown-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edown-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 127ac231ce8c71ab5c76b184efadfdb0a1215e5b1452cda946b988480ceca77b
MD5 163404d5bdb097333a9e38afdfcdffec
BLAKE2b-256 068fc7996c2072da6acc62c134bba746cde309ebcd01291d32cfa5d838f1e366

See more details on using hashes here.

Provenance

The following attestation bundles were made for edown-0.1.1-py3-none-any.whl:

Publisher: publish.yml on MarcYin/edown

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