T-reX.MakeCustomDatabase ======================== .. py:module:: T-reX.MakeCustomDatabase .. autoapi-nested-parse:: MakeCustomDatabase Module ========================= 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 --------- .. autoapisummary:: T-reX.MakeCustomDatabase.get_files_from_tree T-reX.MakeCustomDatabase.dbWriteExcel T-reX.MakeCustomDatabase.determine_unit_from_name T-reX.MakeCustomDatabase.dbExcel2BW Module Contents --------------- .. py:function:: get_files_from_tree(dir_searchmaterial_results, dir_searchwaste_results) Collects filenames from the SearchMaterial and SearchWasteResults directories. :param dir_searchmaterial_results: Directory path for SearchMaterial results. :param dir_searchwaste_results: Directory path for SearchWasteResults. :return: Sorted list of filenames. .. py:function:: dbWriteExcel() 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. :return: Path to the generated xlsx file. .. py:function:: determine_unit_from_name(name) Determine the unit based on the name. :param name: The name from which to infer the unit. :return: The inferred unit as a string. .. py:function:: dbExcel2BW() 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. :return: None