bw2io.export.ecospold1#

Attributes#

Classes#

Ecospold1Exporter

Export one or more datasets to Ecospold1 XML.

Functions#

bool_to_text(→ str)

pretty_number(→ str)

stripper(→ str)

Module Contents#

class bw2io.export.ecospold1.Ecospold1Exporter(schema_location: str | None = None)[source]#

Export one or more datasets to Ecospold1 XML.

The combination of Ecospold1DataExtractor and Ecospold1Exporter does not give prefect roundtrip data flow, especially if data if coming from closed-source software with unspecified behaviour. The following differences have been observed:

  • This class uses an updated Ecospold1 set of XSDs from sami-m-g/pyecospold

  • The dataset generator field is different (bw2io)

  • The dataset number is not preserved

  • Number formatting is different. We round numbers like 10.2000000000000011 to 10.2, and always keep at least one decimal point.

  • We always include an uncertaintyType for exchanges

  • We always include an infrastructureProcess for exchanges (default false)

  • The field dataGeneratorAndPublication is not used consistently - we always fill this with dummy data.

  • We eliminate duplicate identical person elements

  • person and source elements can be renumbered, but references are kept correct

add_dataset(node: dict) None[source]#
write_to_file(filepath: pathlib.Path) None[source]#
property bytes: bytes[source]#
count = 0[source]#
root[source]#
bw2io.export.ecospold1.bool_to_text(b: bool | str) str[source]#
bw2io.export.ecospold1.pretty_number(val: float) str[source]#
bw2io.export.ecospold1.stripper(obj: str, prefix: str) str[source]#
bw2io.export.ecospold1.attr_qname[source]#
bw2io.export.ecospold1.nsmap[source]#
bw2io.export.ecospold1.version = ''[source]#