A Python package that converts ecospold XML formats to their Python equivalents and export the same data back to XML.
Project description
pyecospold
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyecospold-1.0.0.tar.gz
(21.0 kB
view hashes)
Built Distribution
pyecospold-1.0.0-py3-none-any.whl
(20.7 kB
view hashes)
Close
Hashes for pyecospold-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50881e8e26cff6e39f93d286f6a4d82da666e036eb5f5f8d92f25f88aebc8a8a |
|
MD5 | 708680a7dcf400a16263ce7c4380da0b |
|
BLAKE2b-256 | dd8a13cbb122ef50dfa623c0eba80ce776288110f7f0af4446712a6b8e3809e6 |