T-reX.MakeCustomDatabase

This module contains functions for creating an xlsx representation of a Brightway2 database and importing it into Brightway2.

Main functions: - dbWriteExcel: Creates an xlsx file representing a custom Brightway2 database. - dbExcel2BW: Imports the custom database (created by dbWriteExcel) into Brightway2.

Functions

get_files_from_tree(dir_searchmaterial_results, ...)

Collects filenames from the SearchMaterial and SearchWasteResults directories.

dbWriteExcel()

Create an xlsx file representing a custom Brightway2 database.

determine_unit_from_name(name)

Determine the unit based on the name.

dbExcel2BW()

Import the custom database (created by dbWriteExcel) into Brightway2.

Module Contents

T-reX.MakeCustomDatabase.get_files_from_tree(dir_searchmaterial_results, dir_searchwaste_results)[source]

Collects filenames from the SearchMaterial and SearchWasteResults directories.

Parameters:
  • dir_searchmaterial_results – Directory path for SearchMaterial results.

  • dir_searchwaste_results – Directory path for SearchWasteResults.

Returns:

Sorted list of filenames.

T-reX.MakeCustomDatabase.dbWriteExcel()[source]

Create an xlsx file representing a custom Brightway2 database.

This function generates an Excel file which represents a custom database for Brightway2, using predefined directory and database settings.

Returns:

Path to the generated xlsx file.

T-reX.MakeCustomDatabase.determine_unit_from_name(name)[source]

Determine the unit based on the name.

Parameters:

name – The name from which to infer the unit.

Returns:

The inferred unit as a string.

T-reX.MakeCustomDatabase.dbExcel2BW()[source]

Import the custom database (created by dbWriteExcel) into Brightway2.

This function imports a custom Brightway2 database from an Excel file into the Brightway2 software, making it available for further environmental impact analysis.

Returns:

None