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-1.0.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyecospold-1.0.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file pyecospold-1.0.0.tar.gz.

File metadata

  • Download URL: pyecospold-1.0.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for pyecospold-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2a85f56fe0eee3369a102f60467832416835db5a3d84d86e8597d32b0bfe6bff
MD5 520d4886c9c7a78eceaad053f0a79ad4
BLAKE2b-256 13a871620a6fc8e26d88d74302679d2a49d36f6b7005349f6c2ea8b3bcb5f151

See more details on using hashes here.

File details

Details for the file pyecospold-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyecospold-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for pyecospold-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50881e8e26cff6e39f93d286f6a4d82da666e036eb5f5f8d92f25f88aebc8a8a
MD5 708680a7dcf400a16263ce7c4380da0b
BLAKE2b-256 dd8a13cbb122ef50dfa623c0eba80ce776288110f7f0af4446712a6b8e3809e6

See more details on using hashes here.

Supported by

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