Skip to main content

gamma-earth-s2dr

Python client for the Gamma Earth S2DR3 hosted API. It submits a job, follows the job's STAC collection and downloads the products. It is not the Colab SDK (ge-sdk, which runs the model on your own GPU): this talks to the hosted API with your API key.

Status: 0.2.0, used end to end against the public API (a job created, its eight files downloaded). Not yet published to PyPI.

from gamma_earth_s2dr import Client

client = Client()                       # GE_API_KEY from the environment (or Client(api_key=...)); the API is https://api.gamma.earth
job = client.submit((30.906, 51.394, 30.936, 51.422), "2024-06-15")   # lon_min lat_min lon_max lat_max; spends credits
files = job.download("out/")            # waits for the product (minutes; the first job after a quiet spell is slower)

Step by step: job.wait() returns a pystac.ItemCollection (empty while the job runs); client.download(collection, "out/", assets=["tci"]) fetches chosen assets (names: ms, tci, irp, ndvi, and *_10m for the original-resolution files; products made before the STAC release have no item file and are not listed by search() or in collections). To follow a job you already created: client.job("<job id>").

submit spends credits and is not safe to retry: if it fails after the request was sent (a timeout, a lost answer) the job may exist, so check your jobs before submitting again. wait rides out a few transient errors (network, 5xx, 429), stops with JobFailed if the job failed, and says so if a job is completed but no product ever appears.

Search (0.2)

client = Client()
found = client.search(bbox=(30.9, 51.39, 30.94, 51.42), datetime=('2024-06-01', '2024-06-30'), max_clouds=20)
found.products      # your finished products (collection s2dr3)
found.scenes        # unprocessed Sentinel-2 scenes over that area, with a price shown
found.warnings

client.search(ids=['T36UUB-...'])            # by product id
client.search(tile='36UUB', max_items=200)   # follow the next pages (at most 20)

job = client.process(found.scenes[0])                       # NeedsConfirmation: shows the price, spends nothing
job = client.process(found.scenes[0], confirm=True, max_credits=10)
job.download('out/')                          # also writes out/collection.json

A product you already paid for is free to make again, and a search does not list scenes for an area and day you already have a product for. If a job turns out to be a free repeat, job.credits_note says so.

client.catalog() gives the API as a pystac Catalog (browse the collection s2dr3); searching is client.search(), which returns pystac Items. After a download, pystac.ItemCollection.from_file('out/collection.json') works offline: it lists only the files you downloaded, by relative path, without the key or the API address.

Every job created through this package carries "client": "gamma-earth-s2dr/<version>", so the API records it as S2DR3P (P = Python package) in the usage report; plain API calls stay S2DR3A.

Keys and safety

  • The key goes only to your API host: in the URL path for the job API (that is how the job API works today), in the X-API-Key header for the STAC API. It is never sent to the signed download address, never printed, and is removed from every error message. A link in an API answer that is not on the API host is ignored.
  • Downloads are written to <name>.part and renamed only when the size equals Content-Length and the file is a TIFF.
  • The default API is https://api.gamma.earth; GE_API_URL or Client(api_url=...) replace it (for example a test API). The key is always required.

License

Apache License 2.0, Copyright 2026 Gamma Earth (see LICENSE and NOTICE). The license covers this client only, not the S2DR3 model, its wheel or the hosted API. Using the API needs an API key and credits.

Develop

pip install -e ".[test]"
python -m pytest -q

Metadata

Release files for gamma-earth-s2dr 0.2.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 gamma-earth-s2dr 0.2.0
File Size Uploaded Provenance Actions
gamma_earth_s2dr-0.2.0.tar.gz 27.7 kB Without provenance Details for gamma_earth_s2dr-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gamma-earth-s2dr 0.2.0
File Interpreter ABI Platform Actions
gamma_earth_s2dr-0.2.0-py3-none-any.whl Python 3 none any Details for gamma_earth_s2dr-0.2.0-py3-none-any.whl

Total release size: 45.3 kB

Release files / gamma_earth_s2dr-0.2.0.tar.gz

Download URL gamma_earth_s2dr-0.2.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
69be68b16a2b09633f6131a77f95ab0d1c5eae07013a3feb3697b460ec17eff3
BLAKE2b-256 checksum
How to use checksums
81c16b191c934b9c7697b1ff317d707cbd8a5d8bd863a801f0a67226f9336a84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / gamma_earth_s2dr-0.2.0-py3-none-any.whl

Download URL gamma_earth_s2dr-0.2.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85835575edec47b3d39737d23dde1fab8fa090ebc3421bab943f340b242689df
BLAKE2b-256 checksum
How to use checksums
e9e20e2ea5da2422abd12b502dd8b9225279b6f41be74ff8d2b2a6e50845fd46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for gamma-earth-s2dr 0.2.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.2.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