Skip to main content

Sentinel-2 COG Downloader/Loader

Search Element 84 Earth Search for Sentinel-2 L2A Cloud-Optimized GeoTIFFs, stitch every tile needed for full bounding-box coverage, keep only the bands you ask for, and return an xarray array. I know this is a bit niche but I've found myself writing this code multiple times over the years so I'm putting it in a package.

Install

pip install sentinel-2-cog-downloader

Or with uv:

uv add sentinel-2-cog-downloader

Usage

from s2_cog_dl import Downloader, NoViableDataError

downloader = Downloader(
    bbox=[-122.86, 37.61, -122.15, 38.11],  # west, south, east, north
    datetime="2026-01-01",                  # target time; ±14 days by default
    bands=["red", "green", "blue", "nir"],  # or Sentinel-2 aliases like "B04"
    max_cloud_coverage=25,
)

try:
    result = downloader.download()
except NoViableDataError as exc:
    raise

array = result.to_array()   # DataArray with a "band" dimension
dataset = result.to_dataset()

A single date is expanded by search_window_days (default 14). Pass an explicit range to search only that window:

Downloader(bbox=bbox, datetime=["2026-01-01", "2026-01-15"])

Output CRS defaults to the UTM zone of the bbox. Pixel size is metres (resolution=10) and is converted to degrees when crs="EPSG:4326".

Metadata

Release files for sentinel-2-cog-downloader 0.1.1

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

Source distribution (sdist)

Source distribution for sentinel-2-cog-downloader 0.1.1
File Size Uploaded Provenance
sentinel_2_cog_downloader-0.1.1.tar.gz 11.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sentinel-2-cog-downloader 0.1.1
File Interpreter ABI Platform
sentinel_2_cog_downloader-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / sentinel_2_cog_downloader-0.1.1.tar.gz

Download URL sentinel_2_cog_downloader-0.1.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
deee460e01d0cca335776b70bb800304820023aeaf38c2b8ae4824ea5b47f545
BLAKE2b-256 checksum
How to use checksums
f5ab5a899101f334acf10614323325592c09207b4873386640d92494785669f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / sentinel_2_cog_downloader-0.1.1-py3-none-any.whl

Download URL sentinel_2_cog_downloader-0.1.1-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9633334ed3f316563267aafab9fc64975b093d7a14c71471c1045b3e68ef02e3
BLAKE2b-256 checksum
How to use checksums
8928d64704f560eeff89d36b1f18764752ecd48b4ed4a46701e28a5156b41c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Security for sentinel-2-cog-downloader 0.1.1

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