batpy.datasets

Module to load default batpy datasets

Functions

get_available_batpy_dataset_versions(...)

Get available batpy dataset versions

get_latest_batpy_dataset_version(...)

Get latest batpy dataset version

get_batpy_dataset(→ str)

Get included batpy dataset

get_available_batpy_dataset_names(→ list[str])

Get available batpy dataset names

get_dataset_information(→ str)

Get information of dataset

get_available_batpy_datasets(→ dict[str, str])

Get available batpy datasets

get_path(→ pathlib.Path)

Get module path

copy_integrated_brightway_workbook(→ None)

Copy integrated brightway2 workbook to specified location

copy_integrated_dataset(→ None)

Copy integrated dataset to specified location

Module Contents

batpy.datasets.get_available_batpy_dataset_versions() list[semantic_version.Version]

Get available batpy dataset versions

Returns:

List of available batpy dataset versions

Return type:

list[semantic_version.Version]

batpy.datasets.get_latest_batpy_dataset_version() semantic_version.Version

Get latest batpy dataset version

Returns:

Latest batpy dataset version available

Return type:

semantic_version.Version

batpy.datasets.get_batpy_dataset(dataset_name: str, dataset_version: semantic_version.Version | str = None) str

Get included batpy dataset

Parameters:
  • dataset_name (str) – Name of included batpy dataset.

  • dataset_version (semantic_version.Version | str, optional) – Specific version of the included batpy dataset, otherwise latest version available, by default None.

Returns:

File content as string.

Return type:

str

batpy.datasets.get_available_batpy_dataset_names(dataset_version: semantic_version.Version | str = None) list[str]

Get available batpy dataset names

Parameters:

dataset_version (semantic_version.Version | str, optional) – Specific version of the included batpy dataset, otherwise latest version available, by default None.

Returns:

List of included batpy dataset names.

Return type:

list[str]

Raises:

ValueError – If ‘dataset_version’ is not available.

batpy.datasets.get_dataset_information(dataset_stream: str) str

Get information of dataset

Parameters:

dataset_stream (str) – String representation of dataset.

Returns:

Available dataset information

Return type:

str

Raises:

KeyError – If no information is specified

batpy.datasets.get_available_batpy_datasets(dataset_version: semantic_version.Version | str = None) dict[str, str]

Get available batpy datasets

Parameters:

dataset_version (semantic_version.Version | str, optional) – Specific version of the included batpy dataset, otherwise latest version available, by default None.

Returns:

Returns available batpy dataset names and their corresponding information.

Return type:

dict[str, str]

batpy.datasets.get_path(module_name: str | types.ModuleType) pathlib.Path

Get module path

Parameters:

module_name (str | ModuleType) – Module name or class

Returns:

Path of the module

Return type:

Path

batpy.datasets.copy_integrated_brightway_workbook(path_to_save_workbook: pathlib.Path) None

Copy integrated brightway2 workbook to specified location

Parameters:

path_to_save_workbook (Path) – Path to save integrated brigthway2 workbook

batpy.datasets.copy_integrated_dataset(dataset_to_export: str, path_to_save_toml_file: pathlib.Path, dataset_version_to_export: semantic_version.Version | str = None) None

Copy integrated dataset to specified location

Parameters:
  • dataset_to_export (str) – Name of the dataset to export

  • path_to_save_toml_file (Path) – Path to save integrated dataset

  • dataset_version_to_export (semantic_version.Version | str, optional) – Specific version of the included batpy dataset, otherwise latest version available, by default None.