Skip to main content

A Python package that converts ecospold XML formats to their Python equivalents and export the same data back to XML.

Project description

pyecospold

PyPI Status Python Version License

Read the documentation at https://pyecospold.readthedocs.io/ Tests Codecov

pre-commit Black

Installation

You can install pyecospold via [pip] from [PyPI]:

$ pip install pyecospold

Usage

from pyecospold import parse_file, save_file, Defaults

# Override defaults if needed, else skip. Defaults are already set.
Defaults.config("config.ini")  # Replace with your own config file

# Parse the required XML file to EcoSpold class.
ecoSpold = parse_file("data/examples/00001.xml")  # Replace with your own XML file
ecoSpold
>> <Element {http://www.EcoInvent.org/EcoSpold01}ecoSpold at 0x24a558b6020>

# Change whatever attributes you need changing.
referenceFunction = ecoSpold.dataset.metaInformation.processInformation.referenceFunction
referenceFunction.amount = 2.0
referenceFunction.amount
>> 2.0

# Save final EcoSpold class as an XML file, make sure root directory exists.
save_file(ecoSpold, "out/00001_new.xml")  # Replace with your own path

Config file

[defaults]
qualityNetwork="1"
qualityNetwork="1"
uncertaintyType="1"
allocationMethod="-1"
SCHEMA_FILE="data/schema/EcoSpold01Dataset.xsd"

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the BSD license license, pyecospold is free and open source software.

Issues

If you encounter any problems, please [file an issue] along with a detailed description.

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyecospold-0.1.0.tar.gz (21.0 kB view hashes)

Uploaded Source

Built Distribution

pyecospold-0.1.0-py3-none-any.whl (20.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page