geetools.Authenticate#

Toolbox for the ee.Authenticate function.

Package Contents#

Classes#

AuthenticateAccessor

Create an accessor for the ee.Authenticate function.

class geetools.Authenticate.AuthenticateAccessor[source]#

Create an accessor for the ee.Authenticate function.

static delete_user(name='', credential_pathname='')[source]#

Delete a user credential file.

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

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

Return type:

None

Example

import ee
import geetools

# cannot be displayed in the documentation as the creation
# of a new user requires user interaction

# geetools.User.create("secondary")
# geetools.User.delete("secondary")
# geetools.User.set("secondary")
# will raise an error as the user does not exist anymore
static list_user(credential_pathname='')[source]#

return all the available users in the set folder.

To reach “default” simply omit the name parameter in the User methods

Parameters:

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

Returns:

A list of strings with the names of the users

Return type:

list

Example

import ee
import geetools

geetools.User.list(
static new_user(name='', credential_pathname='')[source]#

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) – The path to the folder where the credentials are stored. If not set, it uses the default path

Return type:

None

Example

import ee
import geetools

# cannot be displayed in the documentation as the creation
# of a new user requires user interaction

# geetools.User.create("secondary")
# geetools.User.set("secondary")
# ee.Number(1).getInfo()
static rename_user(new, old='', credential_pathname='')[source]#

Rename a user without changing the credentials.

Parameters:
  • new (str) – The new name of the user

  • old (str) – The name of the user to rename

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

Return type:

None

Example

import ee
import geetools

geetools.user.create("secondary")
geetools.User.rename("secondary", "new_default")
geetools.User.list()