Python wrapper for easier data management on Google Earth Engine.
Project description
eeUtil
Wrapper for easier data management with Earth Engine python sdk
Requires account with access to Google Cloud Storage and Earth Engine.
import eeUtil
# initialize from environment variables
eeUtil.init(project='my-project', bucket='my-bucket')
# create image collection
eeUtil.createFolder('mycollection', imageCollection=True)
# upload image to collection
eeUtil.uploadAsset('image.tif', 'mycollection/myasset')
eeUtil.setAcl('mycollection', 'public')
eeUtil.ls('mycollection')
# export image to cloud storage and download
eeUtil.downloadAsset('mycollection/myasset')
Install
pip install eeUtil
Develop
git clone https://github.com/fgassert/eeUtil.git
cd eeUtil
pip install -e .
Nice things?
- More consistent python bindings
- Adds recursive
copy,move,remove,setAcl,createFolder. - GEE paths not starting with
/,users/projects/are relative to your user root folder (users/<username>orprojects/<project-id>/assets) uploadanddownloadstage files via Google Cloud Storage so you don't have to.
Usage
The easiest way to authorize eeUtil is using service account credentials. Once you create a service account and download your credentials.json set these in your environment.
export GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
Initalize these credentials by calling eeUtil.init().
eeUtil.init()
If you don't provide credentials to eeUtil.init(), it defaults to reading from credentials from the environment, and attempts to read credentials as saved by earthengine authenticate for Earth Engine and gcloud auth application-default login for Google Cloud Storage.
eeUtil.init(service_account=GEE_SERVICE_ACCOUNT,
credential_path=GOOGLE_APPLICATION_CREDENTIALS,
project=GEE_PROJECT,
bucket=GEE_STAGING_BUCKET,
credential_json=GEE_JSON)
service_accountService account name. For more information on GEE service accounts, see: https://developers.google.com/earth-engine/service_account[default: GEE_SERVICE_ACCOUNT]credential_pathPath to json file containing private key. This orcredential_jsonis required for service accounts.[default: GOOGLE_APPLICATION_CREDENTIALS]projectProject to use for GEE and GCS bucket.[default: GEE_PROJECT or CLOUDSDK_CORE_PROJECT]bucketStorage bucket for staging assets for ingestion. Will create new bucket if none provided.[default: GEE_STAGING_BUCKET]credential_jsonPass json string as alternative tocredential_path.[default: GEE_JSON]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eeUtil-0.3.0.tar.gz.
File metadata
- Download URL: eeUtil-0.3.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fa32b342779a084643f44e552bcb59e5fbf8f8d1f711e026ecfc04ed483b560
|
|
| MD5 |
9705694e8de32d9a08003ef3119e2bb6
|
|
| BLAKE2b-256 |
e52d307ee398380f9b4ea19553a38b1985ae9279160e1eff161a28763a5c94dc
|
File details
Details for the file eeUtil-0.3.0-py3-none-any.whl.
File metadata
- Download URL: eeUtil-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acaeb8242acd9d2e88fb9efe6a0082badc0261e1a662be87d391b2254ba6a40d
|
|
| MD5 |
8aed31483197c8d99ef6d27509466924
|
|
| BLAKE2b-256 |
6132eaefb81130cc401be45545577821171491368f99580b15b8d75f1bf53315
|