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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyecospold-0.1.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 70de857dfebb13915b1adf78391946240eb063a97587948fff3c482b5b8f31a6
MD5 3b2a47b8e3bbb173ee7b35e37bfe35f1
BLAKE2b-256 ef8894fe363829d32c9acb3caff2fb13bfd5239bc27d7125ea79025c83c07689

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyecospold-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a767ac32d3b72c0435b981715b30e6a562a7a64066777721b1dc6147a437c91
MD5 533c544d0d4d63a2ed792c4a23a5aac9
BLAKE2b-256 9ab9cd9ec5a2d2b713a0c9d40222624b04b349b04dd0cc827d877f4b02a16676

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