bw2io.backup#

Module Contents#

Functions#

backup_data_directory()

Backup data directory to a .tar.gz (compressed tar archive) in the user's home directory.

backup_project_directory(project)

Backup project data directory to a .tar.gz (compressed tar archive) in the user's home directory.

restore_project_directory(fp[, project_name, ...])

Restore a backed up project data directory from a .tar.gz (compressed tar archive) in the user's home directory.

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#

projectstr

Name of the project to backup.

Returns#

project_namestr

Name of the project that was backed up.

Raises#

ValueError

If the project does not exist.

See Also#

bw2io.backup.restore_project_directory: To restore a project directory from a backup.

bw2io.backup.restore_project_directory(fp: str, project_name: Optional[str] = None, overwrite_existing: Optional[bool] = False)[source]#

Restore a backed up project data directory from a .tar.gz (compressed tar archive) in the user’s home directory.

Parameters#

fpstr

File path of the project to restore.

project_namestr, optional

Name of new project to create

overwrite_existing : bool, optional

Returns#

project_namestr

Name of the project that was restored.

Raises#

ValueError

If the project does not exist.

See Also#

bw2io.backup.backup_project_directory: To restore a project directory from a backup.