Skip to main content

Climate Data Entrepreneurial Club (CDEC)

PyPI - Version PyPI - Python Version

cdec downloads satellite data for a study area from the Copernicus Data Space and draws it. You call one function, you get one (Cloud Optimized) GeoTIFF that you can open with rasterio or QGIS. The package is written for teaching: one function per data type, short readable code, and defaults that work.

It covers fifteen data types: the vegetation, water, moisture and snow indices NDVI, EVI, NDWI, NDMI and NDSI (Sentinel-2), true-colour and false-colour images (urban, infrared and SWIR; Sentinel-2), the Sentinel-2 scene classification, NDVI from the Landsat mosaic, land surface temperature (Sentinel-3), soil water index, elevation and land cover.

Installation

Python 3.10 or newer is required.

pip install cdec

Quick start

You need a free Copernicus Data Space account. The first download opens a login (device code), later downloads reuse the stored token.

from cdec import download_ndvi, plot_ndvi

spatial_extent = {"west": 8.721771, "south": 53.025027, "east": 8.904419, "north": 53.114965}
temporal_extent = ["2024-06-01", "2024-07-01"]

path = download_ndvi("data/ndvi_bremen.tif", spatial_extent, temporal_extent)
plot_ndvi(path)

download_ndvi returns the path of the file, and plot_ndvi draws it:

NDVI of Bremen in June 2024: green fields and parks, yellow-green built-up areas, white patches without data.

Bremen, June 2024. White: no data. Contains modified Copernicus Sentinel data 2024.

To learn what a function writes (bands, data type, unit, no-data value, pixel size) and what its options do, ask Python:

help(download_ndvi)

Data types

One function for each data type. Every download_* function has a plot_* function with the matching name (download_ndvi and plot_ndvi), and a long name that says the same in words (download_normalized_difference_vegetation_index). The long name and the short name are the same function.

The column Temporal extent is the period that the collection covers in openEO (the t dimension of its data cube). Choose your temporal_extent inside it, for example ["2024-06-01", "2024-07-01"] for June 2024 (the end date is not included). Elevation and land cover are static maps and need no period.

Data Download function Source Pixel size Temporal extent
NDVI, vegetation download_ndvi Sentinel-2 10 m 2015-06-27 until present
EVI, vegetation download_evi Sentinel-2 10 m 2015-06-27 until present
NDWI, water download_ndwi Sentinel-2 10 m 2015-06-27 until present
NDMI, moisture of plants download_ndmi Sentinel-2 10 m 2015-06-27 until present
NDSI, snow and ice download_ndsi Sentinel-2 10 m 2015-06-27 until present
True-colour image download_tci Sentinel-2 10 m 2015-06-27 until present
False-colour image, urban download_urban Sentinel-2 10 m 2015-06-27 until present
False-colour image, infrared (vegetation) download_infrared Sentinel-2 10 m 2015-06-27 until present
False-colour image, short-wave infrared download_swir Sentinel-2 10 m 2015-06-27 until present
Scene classification (cloud, water, ...) download_scl Sentinel-2 10 m 2015-06-27 until present
NDVI, long time series download_landsat Landsat mosaic 30 m 1997-01-01 to 2025-12-31
Land surface temperature download_lst Sentinel-3 1 km 2016-04-17 until present
Soil water index download_swi Copernicus Land Monitoring Service 1 km 2025-07-12 until present
Elevation download_dem Copernicus DEM 30 m 2010-12-12 to 2015-01-16 (static)
Land cover download_land_cover ESA WorldCover 2021 10 m 2021 (static)

Build and test

The tests, the documentation and the package are run and built with Hatch:

hatch run test          # all tests that work offline
hatch run docs:build    # the documentation in English and German
hatch run types:check   # type check with mypy
hatch build             # the package (sdist and wheel) in the folder dist/

Tests that download real data need a Copernicus login: hatch run test-live.

License

cdec is distributed under the terms of the MIT license.

Metadata

Release files for cdec 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 cdec 0.1.0
File Size Uploaded Provenance Actions
cdec-0.1.0.tar.gz 3.8 MB Without provenance Details for cdec-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.8 MB

Release files / cdec-0.1.0.tar.gz

Download URL cdec-0.1.0.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
d3906a0ae955a34323e014d0c1e54a3886af91b2c88806a1b04a2d4b0110b557
BLAKE2b-256 checksum
How to use checksums
e76a09483774c1553d3929e7a64d9516635749c4cb0beb5a877b613426671bc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

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

Download URL cdec-0.1.0-py3-none-any.whl
Size 54.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45d766bc2e4726fd62631b30ff10f1e5b05534d82e8b88e642e28adf2e666a30
BLAKE2b-256 checksum
How to use checksums
0e2661ff398c0185e5c4965e57431114e13f7bfc353938ab97fbdc57942470df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.0

Security for cdec 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