bw_simapro_csv.main

Attributes

CONTROL_BLOCK_MAPPING

INDETERMINATE_SECTION_ERROR

INDETERMINATE_SECTION_HEADERS

Classes

SimaProCSV

Read a SimaPro CSV file object, and parse the contents.

Functions

dummy(data, *args)

Module Contents

class bw_simapro_csv.main.SimaProCSV(path_or_stream: pathlib.Path | io.StringIO, encoding: str = 'sloppy-windows-1252', database_name: str | None = None, stderr_logs: bool = True, write_logs: bool = True, copy_logs: bool = False)[source]

Read a SimaPro CSV file object, and parse the contents.

We start with the header, as this defines how the rest of the file is to be parsed. It gives the CSV delimiter and decimal separator.

We then break the file into logical chunks, such as processes or LCIA impact categories.

configure_logs(stderr_logs: bool, write_logs: bool) None[source]
copy_log_dir(base_dir: pathlib.Path) None[source]

Copy the logs directory and its files to base_dir

data_list_not_empty(lst: list) bool[source]
get_next_block(rewindable_csv_reader: bw_simapro_csv.csv_reader.BeKindRewind, header: dict) bw_simapro_csv.blocks.SimaProCSVBlock | None[source]
resolve_parameters() None[source]

Read in input parameters, and resolve formulas.

to_brightway(filepath: pathlib.Path | None = None, separate_products: bool = True, shorten_names: bool = True) dict | pathlib.Path[source]
blocks = [][source]
filepath = ''[source]
header[source]
uses_end_text = False[source]
bw_simapro_csv.main.dummy(data, *args)[source]
bw_simapro_csv.main.CONTROL_BLOCK_MAPPING[source]
bw_simapro_csv.main.INDETERMINATE_SECTION_ERROR = Multiline-String[source]
Show Value
"""
    Flow lists are given at the end of this file, but the section headings for
    flow lists are also used in inventory process descriptions. We can normally
    use the text 'End' to show when a process block stops, but this file doesn't
    seem to use 'End' sections. We therefore can't tell if '{}' is a new block
    or not, and can't parse this file.
"""
bw_simapro_csv.main.INDETERMINATE_SECTION_HEADERS[source]