bw_simapro_csv.header

Attributes

BOOLEAN_LABELS

DELIMITER_MAP

STRING_LABELS

TYPE_TRANSLATIONS

Classes

SimaProCSVHeader

SimaProCSVType

str(object='') -> str

Functions

parse_header(data, int)

Read the header section and parse its values. A typical header looks like:

Module Contents

class bw_simapro_csv.header.SimaProCSVHeader[source]

Bases: pydantic.BaseModel

convert_expressions: bool | None = None[source]
created: datetime.datetime | None = None[source]
csv_version: str[source]
date_separator: str | None = '/'[source]
dayfirst: bool | None = False[source]
decimal_separator: str | None = '.'[source]
delimiter: str[source]
exclude_library_processes: bool | None = None[source]
export_platform_ids: bool | None = None[source]
include_stages: bool | None = None[source]
kind: SimaProCSVType[source]
libraries: List[str] = [][source]
open_library: str | None = None[source]
open_project: str | None = None[source]
project: str | None = None[source]
related_objects: bool | None = None[source]
selection: str | None = None[source]
simapro_version: str[source]
skip_empty_fields: bool | None = None[source]
class bw_simapro_csv.header.SimaProCSVType[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

Initialize self. See help(type(self)) for accurate signature.

methods = 'methods'[source]
processes = 'processes'[source]
stages = 'product stages'[source]
bw_simapro_csv.header.parse_header(data: List[str])[source]

Read the header section and parse its values. A typical header looks like:

{SimaPro 8.2.0.0} {processes} {Date: 10/12/2016} {Time: 10:54:47 PM}

Sometimes these lines can be quoted:

“{Related objects (system descriptions, substances, units, etc.): Yes}”

The generic pattern is:

SimaPro version File export type Key: value dictionary Optional library list

We parse this into a header dictionary, doing type conversion when necessary.

bw_simapro_csv.header.BOOLEAN_LABELS[source]
bw_simapro_csv.header.DELIMITER_MAP[source]
bw_simapro_csv.header.STRING_LABELS[source]
bw_simapro_csv.header.TYPE_TRANSLATIONS[source]