def __init__(self): self.initialize = ee.Initialize() self.credentials = ee.Credentials() self.service = discovery.build(serviceName='drive', version='v3', cache_discovery=False, credentials=self.credentials)
def get_credentials(): credentials = ee.Credentials() if type(credentials) == ThreadLocalCredentials: credentials = credentials.get() if not credentials: raise Exception( 'ee.InitializeThread() has not been called for current thread.') return credentials
def _first_asset_root(): asset_roots = ee.data.getAssetRoots() if not asset_roots: raise Exception('User has no GEE asset roots: {}'.format( ee.Credentials())) return asset_roots[0]['id']
def _first_asset_root(): asset_roots = [bucket['id'] for bucket in ee.data.listBuckets()['assets']] if not asset_roots: raise Exception('User has no GEE asset roots: {}'.format( ee.Credentials())) return asset_roots[0]