bw_simapro_csv.main =================== .. py:module:: bw_simapro_csv.main Attributes ---------- .. autoapisummary:: bw_simapro_csv.main.CONTROL_BLOCK_MAPPING bw_simapro_csv.main.INDETERMINATE_SECTION_ERROR bw_simapro_csv.main.INDETERMINATE_SECTION_HEADERS Classes ------- .. autoapisummary:: bw_simapro_csv.main.SimaProCSV Functions --------- .. autoapisummary:: bw_simapro_csv.main.dummy Module Contents --------------- .. py:class:: SimaProCSV(path_or_stream: Union[pathlib.Path, io.StringIO], encoding: str = 'sloppy-windows-1252', database_name: Optional[str] = None, stderr_logs: bool = True, write_logs: bool = True, copy_logs: bool = False) 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. .. py:method:: configure_logs(stderr_logs: bool, write_logs: bool) -> None .. py:method:: copy_log_dir(base_dir: pathlib.Path) -> None Copy the logs directory and its files to `base_dir` .. py:method:: data_list_not_empty(lst: list) -> bool .. py:method:: get_next_block(rewindable_csv_reader: bw_simapro_csv.csv_reader.BeKindRewind, header: dict) -> Optional[bw_simapro_csv.blocks.SimaProCSVBlock] .. py:method:: resolve_parameters() -> None Read in input parameters, and resolve formulas. .. py:method:: to_brightway(filepath: Optional[pathlib.Path] = None, separate_products: bool = True, shorten_names: bool = True) -> Union[dict, pathlib.Path] .. py:attribute:: blocks :value: [] .. py:attribute:: filepath :value: '' .. py:attribute:: header .. py:attribute:: uses_end_text :value: False .. py:function:: dummy(data, *args) .. py:data:: CONTROL_BLOCK_MAPPING .. py:data:: INDETERMINATE_SECTION_ERROR :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ 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. """ .. raw:: html
.. py:data:: INDETERMINATE_SECTION_HEADERS