geetools.Initialize#

Tools for the ee.Initialize function.

Package Contents#

Classes#

InitializeAccessor

Toolbox for the ee.Initialize function.

class geetools.Initialize.InitializeAccessor[source]#

Toolbox for the ee.Initialize function.

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

Initialize Earthengine API using a specific user.

Equivalent to the ee.initialize function but with a specific credential file stored in the machine by the ee.Authenticate.to_user function.

Parameters:
  • name (str) – The name of the user as saved when created. use default if not set

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

  • project (str) – The project_id to use. If not set, it uses the default project_id of the saved credentials.

Return type:

None

Example

import ee
import geetools

ee.Initialize.from_user("test")

# check that GEE is connected
ee.Number(1).getInfo()
static project_id()[source]#

Get the project_id of the current account.

Returns:

The project_id of the connected profile

Raises:

RuntimeError – If the account is not initialized.

Return type:

str

Examples

import ee, geetools

ee.Initialize.geetools.project_id()