Utility functions for Google Earth Engine
Google Earth Engine (GEE) Utilities
This project provides a few simple utility functions for interacting with GEE.
To function properly, this code needs credentials that it can use to authenticate against the Google Earth Engine API. Credentials can be provided in one of two ways, and the code will look for them in this order:
- Service Account Key.
Before running this code, create an environment variable named
SERVICE_ACCOUNT_KEY containing the JSON key for a Google Cloud service account with the necessary permissions to perform the actions you're trying to perform in GEE.
- Personal Credentials.
Before running this code, authenticate with the Google Earth Engine API using the earthengine command line tool:
$ earthengine authenticate
This project uses Pipenv to manage virtual environments and dependencies. Development-time dependencies are documented in the
Pipfile. Follow the
Pipenv documentation to create a virtual environment and install the dependencies.
This project also uses pre-commit to run various Python code quality checks (linting and styling) on every commit. Before you begin any development work, install the pre-commit hook with:
$ pre-commit install
Makefile prescribes actions to test, build, and publish this code to a Python Package Index (PyPI) repository as described in the following sections.
$ make [test | build | publish]
With the virtual environment active and the dependencies installed, use pytest to run the test suite.
When building via the
make build command, you may optionally append to the package name using the
prerelease argument. For example, if the current version of
geeutils specified in the
setup.py module is
$ make build prerelease=rc1
will produce a package named
geeutils-1.2.3rc1. The default is a beta prerelease name incremented by each git commit (eg/
1.2.3b7 for the seventh commit on this branch). Specify a final release with
$ make build prerelease=""
Note that prerelease names must comply with PEP 440.
$ make publish pypi_repository=pypi
The credentials necessary to publish to the target PyPI repository can be provided in one of two ways.
- As these environment variables:
||PyPI account username. If authenticating using a token, use the literal string
||PyPI account password. If authenticating using a token, use the token contents.|
- At the
$ make publish pypi_repository_username="foo" pypi_repository_password="bar"
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.