Skip to main content

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

ecospold1 Schema Updates

1.1

This library includes a new version of the schema definitions for ecospold1. Version 1.1 includes the following changes:

  • Changed the length restriction on referenceFunction.name to 255
  • Changed the length restriction on referenceFunction.synonym to 255
  • Changed the length restriction on category and subCategory to 255
  • Changed the length restriction on representativeness.productionVolume to 32.000
  • Made telephone optional

These changes were based on how this schema was being used by LCA software.

1.2

Corrected the handling of CAS numbers based on the official documentation:

  • A fixed size isn't required, zero-padding is optional and in any case is not used consistently by LCA software
  • Maximum length is 12, not 11
  • The first element has a minimum size of 2 digits, not 1

Usage

from pyecospold import parse_file_v1, save_ecospold_file, Defaults

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

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

# Change whatever attributes you need changing.
referenceFunction = ecoSpold.datasets[0].metaInformation.processInformation.referenceFunction
referenceFunction.amount
>> 1.0
referenceFunction.amount = 2.0
referenceFunction.amount
>> 2.0

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

Config file

[parameters]
SCHEMA_V1_FILE=path/to/schemas/v1/EcoSpold01Dataset.xsd
SCHEMA_V2_FILE=path/to/schemas/v2/EcoSpold02.xsd

[Allocation]
allocationMethod=-1

[DataEntryBy]
qualityNetwork=1

[Dataset]
validCompanyCodes=CompanyCodes.xml
validRegionalCodes=RegionalCodes.xml
validCategories=Categories.xml
validUnits=Units.xml

[DataSetInformation]
impactAssessmentResult=false
internalVersion=1.0
version=1.0

[Exchange]
uncertaintyType=1

[ReferenceFunction]
infrastructureProcess=true

Contributing

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

License

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

Issues

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

Credits

Metadata

Release files for pyecospold 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyecospold 4.0.1
File Size Uploaded Provenance Actions
pyecospold-4.0.1.tar.gz 134.4 kB Without provenance Details for pyecospold-4.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyecospold 4.0.1
File Interpreter ABI Platform Actions
pyecospold-4.0.1-py3-none-any.whl Python 3 none any Details for pyecospold-4.0.1-py3-none-any.whl

Total release size: 277.0 kB

Release files / pyecospold-4.0.1.tar.gz

Download URL pyecospold-4.0.1.tar.gz
Size 134.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c141a19fa40db766368201b56b6000d7758264b170da0f1ce1ae224ed9f7fe5b
BLAKE2b-256 checksum
How to use checksums
d6027b024dafe64a1d0952363d5b6f6fdebe0a6a8d9eb84af4bd8630251bed9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / pyecospold-4.0.1-py3-none-any.whl

Download URL pyecospold-4.0.1-py3-none-any.whl
Size 142.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a22855a0d2c96d45c7dd2feea8e70c5f3d4268947324f4ee378fc1b7571c8fc1
BLAKE2b-256 checksum
How to use checksums
8ab60922da4632fd1ac7ab0d4daa0755169c7577fd6d94751e5b96ac7dc26e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for pyecospold 4.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page