bw2io.remote#

Attributes#

Functions#

_fetch_projects_config(→ dict)

Indirection point for I/O (easy to mock in tests).

_projects_config_filename(→ str)

Return the config filename given a bd.__version__ (str or tuple).

get_projects(→ dict)

install_project(project_key[, project_name, ...])

Install an existing Brightway project archive.

Module Contents#

bw2io.remote._fetch_projects_config(base_url: str, filename: str) dict[source]#

Indirection point for I/O (easy to mock in tests).

bw2io.remote._projects_config_filename(version) str[source]#

Return the config filename given a bd.__version__ (str or tuple).

bw2io.remote.get_projects(update_config: bool = True, base_url: str = BASE_URL) dict[source]#
bw2io.remote.install_project(project_key: str, project_name: str | None = None, projects_config: dict | None = None, url: str | None = BASE_URL, overwrite_existing: bool | None = False, __recursive: bool | None = False)[source]#

Install an existing Brightway project archive.

By default uses https://files.brightway.dev/ as the file repository, but you can run your own.

Parameters:
  • project_key (str) – A string uniquely identifying a project, e.g. ecoinvent-3.8-biosphere.

  • project_name (str, optional) – The name of the new project to create. If not provided will be taken from the archive file.

  • projects_config (dict, optional) – A dictionary that maps project_key values to filenames at the repository

  • url (str, optional) – The URL, with trailing slash /, where the file can be found.

  • overwrite_existing (bool, optional) – Allow overwriting an existing project

  • __recursive (bool) – Internal flag used to determine if this function has errored out already

Returns:

The name of the created project.

Return type:

str

bw2io.remote.BASE_URL = 'https://files.brightway.dev/'[source]#
bw2io.remote.PROJECTS_BW2[source]#
bw2io.remote.PROJECTS_BW25[source]#
bw2io.remote.cache_dir[source]#