Cloud Free Image Downloader
A small tool to download cloud free images from GEE. Also serves as an example that projects in the DLR MF-DAS organization should follow. You should copy the CI/CD set-up and other practices for your repository.
Installation
This tool relies on Google Earth Engine's Python API which cannot be installed automatically as a dependency. You need to install it from conda-forge in your conda environment:
conda install -c conda-forge earthengine-api
This is assuming you already have a conda environment activated. To install from source code you can do the following:
git clone git@github.com:DLR-MF-DAS/gee_downloader.git
cd gee_downloader
pip install -e .
Or if you don't want the source code you can do:
pip install git+git@github.com:DLR-MF-DAS/gee_downloader.git
Usage
Authenticate to Google Earth Engine (note that authentication mode should be set to notebook)
earthengine authenticate --auth_mode notebook
Then you can run the script by executing the module with the -m flag.
python3 -m gee_downloader --help
Which will tell you what the options for the script are.
Usage: python -m gee_downloader [OPTIONS]
Options:
-i, --geojson TEXT Area of interest in the GeoJSON format [required]
-s, --start-date TEXT Starting date for the composite (yyyy-mm-dd)
[required]
-e, --end-date TEXT End date for the composite (yyyy-mm-dd) [required]
-o, --output-file TEXT File to write the results to [required]
--help Show this message and exit.
For designing command line interfaces I recomment the click library for Python - https://click.palletsprojects.com/.
The implementation of the script can be found under src/gee_downloader/__main__.py. Please consider following this
structure if your project requires you to provide an executable script.
To download some actual data you can try the following arguments from inside the repository file structure of this project.
python3 -m gee_downloader -i test/munich.json -s 2019-01-01 -e 2019-04-01 --output-file test.tiff
Which should result in a 13 band image part of which looks like this.
CI/CD Setup
Testing
For testing you should use https://docs.pytest.org/. The GitHub Actions workflow file that runs the tests is located under gee_downloader/.github/workflows/python-app.yml. Use it and the tests under the test/ subdirectory as an example for your own projects.
Documentation
The documentation for this library is automatically built and uploaded to GitHub Pages on each commit. The workflow responsible for this is defined at gee_downloader/.github/workflows/pdoc.yml. I prefer to use pdoc for documentation building (over sphinx which is in my view an outdated abomination) but if you prefer to use something more complex the idea behind building and publishing it stays the same.
You can find the documentation here: https://dlr-mf-das.github.io/gee_downloader/
Publishing
Metadata
Release files for gee-downloader 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gee_downloader-0.0.1.tar.gz | 4.3 kB | Without provenance | Details for gee_downloader-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gee_downloader-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for gee_downloader-0.0.1-py3-none-any.whl |
Total release size: 8.8 kB
Release files / gee_downloader-0.0.1.tar.gz
| Download URL | gee_downloader-0.0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d703a229a87a4a56b4cb6379992850ca3a284755bc067603ddafeb7498730978
|
|
BLAKE2b-256 checksum How to use checksums |
9a80e37ee5c566d6a7de2ae6c5f11a337eef7f802fb46730e8505b3d2841863e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / gee_downloader-0.0.1-py3-none-any.whl
| Download URL | gee_downloader-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d4cec83e96b236fded6a5ecfd45aef90b36b0dc237c4ae61edac8550c226566
|
|
BLAKE2b-256 checksum How to use checksums |
5b70664f65c953f738a5d6b291e04eaf2bccfc3496bef70a257f6566eb269ae6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for gee-downloader 0.0.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.