This package converts Life Cycle Assessment inventory formats. Lavoisier is developed by the Center of Life Cycle Sustainable Assessment (Gyro) of the Federal University of Technology - Paraná (UTFPR) and the Brazilian Institute for Information in Science and Technology (IBICT)
Project description
Lavoisier
Python library for conversions between Life Cycle Assessment (LCA) inventory formats. Currently, it does both ways of conversion between EcoSpold 2 and ILCD 1 formats. Other versions and other dataset types are to be included due time as Lavoisier is a work in progress.
Lavoisier's objective is to make possible a cohesive conversion with lower loss of information between LCA inventory formats. This objective is in line with the efforts in the LCA community for a higher interoperability within data formats, in a way having a dataset of one inventory format does not limit its usability with other inventory formats.
Right now, Lavoisier is incorpored in the Brazilian Life Cycle Inventory database (namely SICV-Brasil) to make possible the conversion of Ecospold 2 datasets from Brazilian reseach to ILCD 1 format on the upload process.
The field conversion is based on Greendelta's converter https://github.com/GreenDelta/olca-conversion-service, but Lavoisier can overcome some shortcomings from OpenLCA converter such as loss of Pedigree matrix uncertainty and coefficient information, some input flows not converted and loss of all parameters and mathematical equations.
The project is still updating frequently and feedback is welcomed. The current version is 2.0.15. The pypi repo is currently https://test.pypi.org/project/Lavoisier/. Tests are made mainly on Linux (Ubuntu).
Installation
Lavoisier will require the following packages:
pathlib
to help with file and diretory pathspint
to help with unit conversionxmltodict
to help with XML parsingopenturns
to help with uncertainty conversionCrypto
to help with UUID conversion
To install the dependencies beforehand, use the commands below
- Install dependent libraries
pip install pathlib pint xmltodict openturns crypto
- Install Lavoisier
python3 pip install -i https://test.pypi.org/simple/ Lavoisier
If you want to install it via github clone, just execute the setup.py
file. In the case of uninstalling or trying to install it by pip again, it is recomended to run as administrator or sudo, since problems related to .pyc
files could raise. Follow the steps bellow:
- Clone github repository
git clone https://github.com/JosePauloSavioli/IBICT-converter
- Go to repository and install the library
cd path/to/cloned/library
python3 setup.py install
Conversion
Lavoisier works by creating a Converter
class using the method get_converter(input_: tuple, output: tuple, path: str, save_path: str, mode: str)
. The input_
and output
tuples are the format and elementary flow mapping to be used in conversion. Currently, available format options are "ILCD1"
and "EcoSpold2"
and available elementary flow mappings are "EF3.0"
for ILCD and "ecoinvent3.7"
for EcoSpold 2. The mode
is an entry to specify if the conversion is to single file(s) of the output format (to file
) or to a single database (to database
- available only for EcoSpold2 to ILCD1 conversion).
The Converter
class has the information about the two formats and is changeable within that conversion. It has a main attributes that can be changed before conversion: the elementary flow mapping file (attr: elem_flow_mapping
). Other attributes are set depending on the conversion being carried out. Too see these attribute options one can print the converter.
For example, to convert a file and a directory of files from EcoSpold 2 to ILCD 1:
# To convert a file
converter = get_converter(("EcoSpold2", "ecoinvent3.7"), ("ILCD1", "EF3.0"),
"path_to_file", "path_to_save_directory", "to_file")
# To convert a directory with files
converter = get_converter(("EcoSpold2", "ecoinvent3.7"), ("ILCD1", "EF3.0"),
"path_to_directory", "path_to_save_directory", "to_file")
# To see the available options
print(converter)
The Converter
class has one method called convert
which is used to carry out the conversion at any given time.
converter.convert()
Support
This projects were supported by the GYRO laboratory from the Federal University of Technology - Paraná (UTFPR) with the Brazilian Institute of Information in Science and Technology (IBICT) and the help of Embrapa. It began with the support of REAL (Resource Efficiency through Application of Life Cycle Thinking) of the UN Environment and The Life Cycle Initiative funded by the European Commission. -> GYRO website: http://gyro.ct.utfpr.edu.br
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.