Skip to main content

aef-download

aef-download is a Python package and CLI for downloading yearly AlphaEarth Foundations embeddings for arbitrary regions from the public AlphaEarth mosaic hosted on Source Cooperative.

It is designed for workflows where you want to:

  • download one or more years for a custom region
  • use a boundary file or a direct bbox
  • write local yearly Zarr stores
  • optionally mask pixels outside the requested polygon
  • resume interrupted downloads safely

Features

  • boundary files readable by geopandas (GeoJSON, GPKG, SHP, and more)
  • direct bbox input in EPSG:4326
  • yearly downloads for 2017-2025
  • local yearly Zarr outputs
  • optional boundary mask
  • optional dequantized float32 output
  • resumable downloads via .progress.json
  • both CLI and Python API

Install

From PyPI

Once published:

pip install aef-download

From GitHub

pip install git+https://github.com/Caojun-whu/aef-download.git

From a local clone

pip install -e .

Data source

The package reads from the public AlphaEarth mosaic:

This package downloads regional subsets from that public mosaic. It does not download the full global dataset.

By default, downloaded embeddings are stored as quantized int8. Use dequantize=True or --dequantize if you want float32 outputs instead.

CLI quickstart

Download one year using a boundary file:

aef-download download-year \
  --boundary region.geojson \
  --year 2022 \
  --output-dir ./out \
  --mask-boundary

Download multiple years:

aef-download download-years \
  --boundary region.geojson \
  --year-start 2017 \
  --year-end 2025 \
  --output-dir ./out \
  --mask-boundary

Download using a bbox:

aef-download download-year \
  --bbox 112.95 22.56 114.05 23.93 \
  --year 2022 \
  --output-dir ./out

Estimate storage without downloading:

aef-download estimate-years \
  --boundary region.geojson \
  --year-start 2017 \
  --year-end 2025

Python API quickstart

from aef_download import download_year, estimate_year

estimate = estimate_year(
    boundary_path="region.geojson",
    year=2022,
)
print(estimate["estimated_storage"])

output = download_year(
    boundary_path="region.geojson",
    year=2022,
    output_dir="./out",
    mask_boundary=True,
)
print(output)

Using a bbox:

from aef_download import download_year

output = download_year(
    bbox=(112.95, 22.56, 114.05, 23.93),
    year=2022,
    output_dir="./out",
)
print(output)

Output format

Each year is written as:

  • {prefix}_{year}.zarr
  • {prefix}_{year}.zarr.progress.json

The Zarr store contains:

  • embeddings
  • x
  • y
  • mask when mask_boundary=True

Typical Zarr attributes include:

  • year
  • bbox
  • boundary_source
  • mask_boundary
  • dequantized
  • source mosaic settings

Resume behavior

Downloads are written chunk by chunk. If interrupted, rerun the same command without --overwrite; completed chunks will be skipped and the download will resume from the progress file.

Notes

  • Supported years are 2017-2025.
  • Bboxes are interpreted as (xmin, ymin, xmax, ymax) in EPSG:4326.
  • Boundary files are normalized to EPSG:4326 before slicing the AlphaEarth mosaic.

Development

Run tests:

python -m pytest tests -q

Check the CLI:

aef-download --help

Build a release:

python -m build
python -m twine check dist/*

Metadata

Release files for aef-download 0.1.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 aef-download 0.1.0
File Size Uploaded Provenance
aef_download-0.1.0.tar.gz 15.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aef-download 0.1.0
File Interpreter ABI Platform
aef_download-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / aef_download-0.1.0.tar.gz

Download URL aef_download-0.1.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
321e7f1231c552276098588ebc0197d7a1b0c3cf44fa1fff5f14af9928afe456
BLAKE2b-256 checksum
How to use checksums
a2d1697cfd07799d44ec3babed30ee34ab91443391f6ecb76825a25b46f17a49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / aef_download-0.1.0-py3-none-any.whl

Download URL aef_download-0.1.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4de85522fb4e790f2198f337bb7e13c1a1a8bf9191c70c232e01f46c53a03741
BLAKE2b-256 checksum
How to use checksums
422fbe1271b076947c6b61299a6908f98690022144e74371bc790bbddf1fc0fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for aef-download 0.1.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

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