Skip to main content

An Earth Engine account manager.

Project description

eeauth

Earth Engine Python PyPI version Build status

An account manager for the Earth Engine Python API that lets you easily authenticate and switch between multiple Google accounts.

Installation

From PyPI

pip install eeauth

From conda-forge

Coming soon!

Usage

Authenticate

Import eeauth, then authenticate a user by running eeauth.authenticate("username") and following the usual authentication instructions[^authenticate], being sure to select the correct Google account[^username]. The credentials for each authenticated user are stored by eeauth for later use.

import ee
import eeauth

# Authenticate and register credentials for multiple accounts
eeauth.authenticate("personal")
eeauth.authenticate("work")

Initialize

With two users authenticated, you can now initialize Earth Engine with a specific user and switch between them at will.

# Get tasks from your "personal" account
eeauth.initialize("personal")
ee.data.getTaskList()

# And from your "work" account
eeauth.initialize("work")
ee.data.getTaskList()

CLI

The eeauth command line interface lets you manage your authenticated users from the terminal.

Usage: eeauth [OPTIONS] COMMAND [ARGS]...

  Manage Earth Engine authentication.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  activate      Set USER as the default Earth Engine user.
  authenticate  Authenticate USER and store their credentials.
  list          List all authenticated users.
  remove        Remove USER from the registry.

FAQ

How does it work?

When you run ee.Authenticate(), Earth Engine stores a single credential file on your local machine. To initialize with a different account, you typically need to repeat the authentication process, replacing your old credentials with new credentials. eeauth allows you to store multiple credentials tied to unique usernames, so that you can quickly switch between authenticated users without the hassle of re-authenticating every time.

Can I still use ee.Initialize()?

Earth Engine will continue to store the most recently authenticated credentials, so ee.Initialize() will work like it always has. You can also run eeauth activate [USER] in a terminal to change which user gets initialized by default.

Is it safe?

Like Earth Engine, eeauth stores your credentials in an unencrypted local file[^registry]. As long as you don't share that file, you should be good to go.

[^authenticate]: eeauth.authenticate calls ee.Authenticate under the hood and accepts the same arguments. The only difference is that eeauth.authenticate stores your credentials with your requested username. [^registry]: Credentials are stored in ~/.config/eeauth/registry.json. [^username]: Usernames do not need to match the name of your Google account.

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

eeauth-0.1.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

eeauth-0.1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file eeauth-0.1.2.tar.gz.

File metadata

  • Download URL: eeauth-0.1.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.1

File hashes

Hashes for eeauth-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9b9cd8b7a92b1c47be22e110609d0bdba355c129df5ac91f94a6e9d82c5ae09d
MD5 3c8a45449f93c8f4d6bf573de37bfca3
BLAKE2b-256 07a6277c1aff85d92f4b5743191d18da2a53b44ff9495c58a932e18157c3777d

See more details on using hashes here.

File details

Details for the file eeauth-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: eeauth-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.1

File hashes

Hashes for eeauth-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c707353b316c0a044ba43bf1b1da4990b4dbd05f924e8c0bc8429818be05580c
MD5 9a08d54e51c5fa3b696a625af4e9a56a
BLAKE2b-256 de78bc0821acbb8c6f2a715aee3731c28d1c09cf9a421af898740d382c9b41b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page