Import EcoInvent Library

It is possible to import either an LCIA or a full database of EcoInvent activities and impacts into an LCA as Code project.

In order to do so, one must have the database bought from EcoInvent and downloaded from https://ecoquery.ecoinvent.org in 7z format. The data will be imported and converted into .lca files, allowing seamless integration with the rest of the project, including one-click navigation, hover documentation, and autocomplete.

EcoInvent LCIA Database

To import an LCIA database into an LCA as Code project, open the "Files" menu, and follow into "Import" and finally select "EcoSpold LCIA library".

An image showing the chain of menus to imports

You will then be offered the following options:

An image showing the EcoInvent LCIA import menu

Location

This is the directory on your computer where the imported files will be stored. Usually, this directory will be somewhere within the project you are working on so that you can include the imported processes in your project. The import process will create a file called main.lca containing a summary of the import, a file called units.lca containing all the required units for the imported exchanges, and a directory called processes containing all the activities, grouped by category.

Root Package

This field allows you to set a package declaration to be written at the top of the imported files. This allows you to scope your data, and you will need to add an import statement towards your library in your project.

File to Import

This field is used to fill in the location of the archive file containing the library you want to import, for example your ecoinvent 3.9.1_cutoff_lcia_ecoSpold02.7z file.

Method Name

When you import an LCIA database, you must choose a specific method for which you want to write the results (if several methods are needed, you can easily import them to different packages). The system will automatically list all and only the methods available in the file you have provided.

LCIA Usage

If, for example, you have imported the EcoInvent LCIA library with the "EF v3.1" method and a root package of eflcia, then you will get the following main file in the directory you have chosen:

package eflcia

// Import Method: EF v3.1
// Date: 2023-09-15T14:47:58.725395979+02:00[Europe/Paris]
// Import Summary:
//     * 728 units
//     * 21238 processes
//     * 21238 substances
// Duration: 02m 09s

You can then use the products defined in your import in your own projects, and use the imported data during assessment, with help of the autocomplete:

An image showing the autocomplete of an imported library

EcoInvent UPR database

To import a complete UPR library into an LCA as Code project, open the "Files" menu, and follow into "Import" and finally choose "EcoSpold UPR Library".

An image showing the chain of menus to imports

You will then be offered the following options:

An image showing the EcoInvent UPR import menu

Location

This is the directory on your computer where the imported files will be stored. Usually, this directory will be somewhere within the project you are working on so that you can include the imported processes in your project. The import process will create a file called main.lca containing a summary of the import, a file called units.lca containing all the required units for the imported exchanges, and a directory called processes containing all the activities, grouped by category.

Root Package

This field allows you to set a package declaration to be written at the top of the imported files. This allows you to scope your data, and you will need to add an import statement towards your library in your project.

File to Import

This field is used to fill in the location of the archive file containing the library you want to import, for example your ecoinvent 3.9.1_cutoff_ecoSpold02.7z file.

Method Mapping File

This field allows you to specify a mapping between the biosphere substances, categories and subcategories named and used in the imported EcoSpold file and another nomenclature, for example the one of PEF. If the EcoSpold library is obtained from EcoInvent, it is possible to contact their support to obtain such a mapping file for the method of your choice, which will usually come under the form of a <method>_mapped_3.9.1.xslx file, which you can then save as a CSV file:

A screenshot of the EF3.1 mapping file

However, any file is accepted as long as:

  • It is encoded in UTF-8
  • It is a valid comma-separated CSV file
  • It contains the following fields:
    • "compartment_status"
    • "conversion_factor"
    • "flow_status"
    • "id"
    • "method_compartment"
    • "method_name"
    • "method_subcompartment"
    • "method_unit"
    • "name"
    • "unitName"

The system will then automatically map each substance's name, compartment, subcompartment and unit to the corresponding values in the described method, doing any unit and quantity conversions required.

Select EF method

If you have chosen to use a mapping from the EcoInvent nomenclature to one of the EF method nomenclatures, you can automatically link the resulting import to the built-in support for EF 3.1 and EF 3.0, by telling the importer to add the import ef31 or import ef30 statement at the top of each generated file.

Example usage

In the same way as in the LCIA example, once you have imported a UPR library into your project with a given root package name, e.g. efupr, you can write:

package demonstration

import efupr

process proc {
    products {
        1 kg my_product
    }
    inputs {
        1 kg activated_carbon_granular from activated_carbon_production_granular_from_hard_coal_rer
    }
}

And when you try to assess the process proc, the required data will be pulled from the imported files.