geeViz.migrateGEEAssets

Recursively migrate Google Earth Engine assets from one repository to another, manage their permissions, and (optionally) delete the originals.

Requirements — the credential you use must either:

  • have editor permissions in both the source and destination repositories, OR

  • have editor permissions in the destination repository AND be willing to change the permissions of all original assets to “Anyone Can Read” (set changePermissions = True in the __main__ block below).

Usage: edit the sourceRoot / destinationRoot / permission variables at the bottom of this file, then run it directly:

$ python -m geeViz.migrateGEEAssets

Importing this module (as autodoc / other tooling does) is a no-op — the migration logic only executes under the if __name__ == "__main__": guard.

Written by:

Ian Housman ian.housman@usda.gov / ian.housman@gmail.com Leah Campbell leah.campbell@usda.gov / leahs.campbell@gmail.com RedCastle Resources Inc. (MIT License)

Functions

batchChangePermissions([assetList, root, ...])

Sets permissions for all files under a specified root level or for a provided list of assets.

copyAssetTree(fromRoot, toRoot[, ...])

Copies all folders, imageCollections, images, and tables under a given folder or imageCollection level.

deleteAssetTree(root)

Deletes all folders, imageCollections, images, and tables under a given folder or imageCollection level.

getTree(fromRoot, toRoot[, treeList])

Recursively gets all folders, imageCollections, images, and tables under a given folder or imageCollection level.