bw2data.project#
Attributes#
Classes#
Functions#
|
|
|
Module Contents#
- class bw2data.project.ProjectManager[source]#
Bases:
collections.abc.Iterable
- _restore_orig_directory()[source]#
Point the ProjectManager back to original directories.
Used exclusively in tests.
- _use_temp_directory()[source]#
Point the ProjectManager towards a temporary directory instead of user_data_dir.
Used exclusively for tests.
- copy_project(new_name, switch=True)[source]#
Copy current project to a new project named
new_name. Ifswitch, switch to new project.
- delete_project(name=None, delete_dir=False)[source]#
Delete project
name, or the current project.nameis the project to delete. Ifnameis not provided, delete the current project.By default, the underlying project directory is not deleted; only the project name is removed from the list of active projects. If
delete_dirisTrue, then also delete the project directory.If deleting the current project, this function sets the current directory to
defaultif it exists, or to a random project.Returns the current project.
- purge_deleted_directories()[source]#
Delete project directories for projects which are no longer registered.
Returns number of directories deleted.
- report()[source]#
Give a report on current projects, including installed databases and file sizes.
Returns tuples of
(project name, number of databases, size of all databases (GB)).
- request_directory(name)[source]#
Return the absolute path to the subdirectory
dirname, creating it if necessary.Returns
Falseif directory can’t be created.
- bw2data.project.READ_ONLY_PROJECT = Multiline-String[source]#
Show Value
""" ***Read only project*** This project is being used by another process and no writes can be made until: 1. You close the other program, or switch to a different project, *and* 2. You call `projects.enable_writes` *and* get the response `True`. If you are **sure** that this warning is incorrect, call `projects.enable_writes(force=True)` to enable writes. """
