bw_simapro_csv.header ===================== .. py:module:: bw_simapro_csv.header Attributes ---------- .. autoapisummary:: bw_simapro_csv.header.BOOLEAN_LABELS bw_simapro_csv.header.DELIMITER_MAP bw_simapro_csv.header.STRING_LABELS bw_simapro_csv.header.TYPE_TRANSLATIONS Classes ------- .. autoapisummary:: bw_simapro_csv.header.SimaProCSVHeader bw_simapro_csv.header.SimaProCSVType Functions --------- .. autoapisummary:: bw_simapro_csv.header.parse_header Module Contents --------------- .. py:class:: SimaProCSVHeader Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: convert_expressions :type: Optional[bool] :value: None .. py:attribute:: created :type: Optional[datetime.datetime] :value: None .. py:attribute:: csv_version :type: str .. py:attribute:: date_separator :type: Optional[str] :value: '/' .. py:attribute:: dayfirst :type: Optional[bool] :value: False .. py:attribute:: decimal_separator :type: Optional[str] :value: '.' .. py:attribute:: delimiter :type: str .. py:attribute:: exclude_library_processes :type: Optional[bool] :value: None .. py:attribute:: export_platform_ids :type: Optional[bool] :value: None .. py:attribute:: include_stages :type: Optional[bool] :value: None .. py:attribute:: kind :type: SimaProCSVType .. py:attribute:: libraries :type: List[str] :value: [] .. py:attribute:: open_library :type: Optional[str] :value: None .. py:attribute:: open_project :type: Optional[str] :value: None .. py:attribute:: project :type: Optional[str] :value: None .. py:attribute:: related_objects :type: Optional[bool] :value: None .. py:attribute:: selection :type: Optional[str] :value: None .. py:attribute:: simapro_version :type: str .. py:attribute:: skip_empty_fields :type: Optional[bool] :value: None .. py:class:: SimaProCSVType Bases: :py:obj:`str`, :py:obj:`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. .. py:attribute:: methods :value: 'methods' .. py:attribute:: processes :value: 'processes' .. py:attribute:: stages :value: 'product stages' .. py:function:: parse_header(data: List[str]) -> (SimaProCSVHeader, int) 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. .. py:data:: BOOLEAN_LABELS .. py:data:: DELIMITER_MAP .. py:data:: STRING_LABELS .. py:data:: TYPE_TRANSLATIONS