bw2io.backup#
Functions#
Backup data directory to a |
|
|
Backup project data directory to a |
|
Restore a backed up project data directory from a |
Module Contents#
- bw2io.backup.backup_data_directory()[source]#
Backup data directory to a
.tar.gz(compressed tar archive) in the user’s home directory. Restoration is done manually.Examples
>>> bw2io.bw2setup() >>> bw2io.backup.backup_data_directory() Creating backup archive - this could take a few minutes...
- bw2io.backup.backup_project_directory(project: str)[source]#
Backup project data directory to a
.tar.gz(compressed tar archive) in the user’s home directory.- Parameters:
project (str) – Name of the project to backup.
- Returns:
project_name – Name of the project that was backed up.
- Return type:
str
- Raises:
ValueError – If the project does not exist.
See also
bw2io.backup.restore_project_directoryTo restore a project directory from a backup.
- bw2io.backup.restore_project_directory(fp: str, project_name: str | None = None, overwrite_existing: bool | None = False)[source]#
Restore a backed up project data directory from a
.tar.gz(compressed tar archive) in the user’s home directory.- Parameters:
fp (str) – File path of the project to restore.
project_name (str, optional) – Name of new project to create
overwrite_existing (bool, optional)
- Returns:
project_name – Name of the project that was restored.
- Return type:
str
- Raises:
ValueError – If the project does not exist.
See also
bw2io.backup.backup_project_directoryTo restore a project directory from a backup.