isogeo_migrations_toolbelt.backup.backup_manager module¶
-
class
isogeo_migrations_toolbelt.backup.backup_manager.
BackupManager
(api_client: isogeo_pysdk.isogeo.Isogeo, output_folder: str)[source]¶ Bases:
object
Backup Manager makes it easy to backup Isogeo data (metadata, contacts, workgroups…). It uses the Isogeo Python SDK to download data asynchronously.
Parameters: - api_client (Isogeo) – API client authenticated to Isogeo
- output_folder (str) – path to the folder where to store the exported data
-
metadata
(search_params: dict, output_format: str = 'json') → bool[source]¶ Backups every metadata corresponding at a search. It builds a list of metadata to export before transmitting it to an async loop.
Parameters: - search params (dict) – API client authenticated to Isogeo
- output_format (str) – format of exported data. Until now, only JSON is available.
Returns: True if export reached the end
Return type: bool
Example: # prepare backup manager backup_mngr = BackupManager(api_client=isogeo, output_folder="./output") # build search parameters. For example to filter on two specifics metadata search_parameters = { "query": None, "specific_md": [ METADATA_UUID_1, METADATA_UUID_2, ], } # launch the backup backup_mngr.metadata(search_params=search_parameters)