new_user#

static geetools.ee_authenticate.AuthenticateAccessor.new_user(name='', credential_pathname='', key_data=None)#

Authenticate the user and save the credentials in a specific folder.

Equivalent to ee.Authenticate() but where the registered user will not be the default one (the one you get when running ee.Initialize()).

Parameters:
  • name (str) – The name of the user. If not set, it will reauthenticate default.

  • credential_pathname (str | os.PathLike) – The path to the folder where the credentials are stored. If not set, it uses the default path.

  • key_data (dict | None) – The json private key of the service account as a dict object. If not set, it will use the web-based authentication.

Example

import ee
import geetools

# cannot be displayed in the documentation as the creation
# of a new user requires user interaction
ee.Authenticate.geetools.new_user("secondary")
ee.Initialize.geetools.from_user("secondary")
ee.Number(1).getInfo()