Skip to main content

Python class regionalizing processes from the ecoinvent database using trade date from the UN COMTRADE database and common sense.

Project description

Regioinvent

Regioinvent is a Python package for automatically connecting the ecoinvent database to BACI, a trade database.

Connecting to a trade database enables a more realistic description of average supply chains within the ecoinvent database through the introduction of consumption markets, based on international import data and production data. The result is a version of ecoinvent which almost does not rely on non-national processes such as RER, RoW or GLO.

Furthermore, since the resulting regionalized version of ecoinvent relies much less on broad regions, the regionalization of impacts can show its full potential. Therefore, Regioinvent also fully spatializes all relevant elementary flows and connects these spatialized elementary flows to regionalized life cycle impact assessment methods. There are currently three LCIA regionalized methods implemented: IMPACT World+ v2.2.1 / EF 3.1 / ReCiPe 2016 v1.03 (H).

Showcase

To showcase what Regioinvent does, let's illustrate on a random example: the production of diethanolamine in Sweden.

Within ecoinvent, the production of diethanolamine is only available for Europe (RER) and Rest-of-the-World (RoW).

Screenshot below shows the diethanolamine production process for Europe (values are hidden for ecoinvent licensing reason). Notice how there is absolutely nothing adapted for the Swedish context, which is normal since it's for Europe as a whole.

After running Regioinvent three types of processes are created.

  1. National production processes

National production processes for many countries and all traded commodities of ecoinvent are created automatically. Below you can see the example for the Swedish production. Now you can see that basically everything is adapted to the Swedish context, energy vectors (electricity/heat), consumables (ammonia) and even capital goods (chemical factory).

  1. National consumption markets

National consumption markets representing the average origin of a commodity purchased in a given country, based on import and domestic production data are created. Below you can see the example for the Swedish consumption market of ammonia that is used in the production of diethanolamine. We can see that Sweden is importing ammonia mainly from Russia (~73%), from the Netherlands (~7%) and from Algeria (~5%). Of course, all these national production processes of ammonia were created along all the other national production processes.

  1. A global production market

Global production markets, representing the global production shares for each commodity, are also created. Below you can see the one for the production of diethanolamine which, according to our data, is mostly produced in Saudi Arabia (~55%), Malaysia (~10%), Belgium (~10%), Germany (~8%) and Sweden (~5%).

Regioinvent in your LCAs

Use the three types of processes generated with Regioinvent as follows:

  • If you know where the production of your commodity occurs, select the corresponding national production process. Either for the location exactly, or, if unavailable, the RoW version which is an aggregate of all the countries not being in the biggest producers. (Of course add some transportation on top of these processes to model their distribution)
  • If you don't know where the production of your commodity occurs, BUT you know where it was bought, rely on the consumption markets. These describe where the commodity should come from, on average, given the trade of the region.
  • If you don't know anything about the process, you can either use the RoW or GLO process of ecoinvent, or rely on the global production process of Regioinvent.

Get started

Regioinvent can be installed through pip.

Install with Brightway2-compatible libraries:

pip install "regioinvent[bw2]"

Install with newer Brightway 2.5-compatible libraries:

pip install "regioinvent[bw25]"

For local development (editable install) from a cloned repository:

pip install -e ".[bw2]"
# or
pip install -e ".[bw25]"

If Brightway libraries are already installed and should not be touched:

pip install -e . --no-deps

You will need a few things to get started:

  • Regioinvent does not provide the ecoinvent database, so you need to buy an ecoinvent license yourself.
  • Download all the required trade data that were already extracted. You can download it from here. Make sure to take the latest available version.
  • Install Brightway libraries and have a Brightway project with an accepted version of ecoinvent.

Note that regioinvent currently supports the ecoinvent 3.10/3.10.1/3.11/3.12 cut-off versions.

You can then follow the steps presented in the demo.ipynb Jupyter notebook.

Recommended python version: 3.11.8

User workflow

The recommended user-side workflow is now:

import regioinvent

regio = regioinvent.Regioinvent(
    bw_project_name="your-brightway-project",
    ecoinvent_database_name="your-ecoinvent-database",
    ecoinvent_version="3.12",
)

regio.spatialize_my_ecoinvent()
regio.import_fully_regionalized_impact_method()  # optional
regio.regionalize_ecoinvent_with_trade(
    trade_database_path="/path/to/trade_data.db",
    target_database_name="Regioinvent",
    cutoff=0.99,
)

Important notes:

  • spatialize_my_ecoinvent() now writes biosphere3_spatialized_flows, but keeps the spatialized ecoinvent copy in memory at this stage.
  • regionalize_ecoinvent_with_trade(...) now performs the in-memory relinking between the spatialized ecoinvent copy and the regioinvent database, and then writes both Brightway databases at the end of the workflow.
  • You no longer need to call write_database() separately after regionalize_ecoinvent_with_trade(...) in the normal high-level workflow.
  • The final Brightway databases are:
    • your-ecoinvent-database - regionalized
    • the target_database_name you passed, e.g. Regioinvent

How to use after running the code?

Once the workflow has finished, the spatialized ecoinvent copy and the regioinvent database have already been written to your Brightway project. You can then perform your LCAs either through Brightway or activity-browser as you would with the regular ecoinvent database.
Do note that calculations can be longer with Regioinvent depending on the cutoff you select. WIth a cutoff of 0.75, calculations times are similar to ones with normal ecoinvent (a few seconds). With a cutoff of 0.99, the size of the regioinvent database increases dramatically, and so does the calculation time (from 5 to 15 minutes depending on your machine).
There are currently no support for other LCA software, as SimaPro and openLCA are not able to support the size of the regioinvent database.

Overview of the methodology

For a deep dive in the methodology of regioinvent, take a look at the Methodology.md file.

  1. Closest available process in ecoinvent is copied and adapted for electricity, heat and waste inputs
  2. National consumption markets are created based on import and production data
  3. The national consumption markets are connected to the rest of the database
  4. Elementary flows are spatialized

Adaptations

Future developments

Next steps for regioinvent are to:

  • adapt the transportation within the different markets to reflect the origins of commodities
  • link with the LC-impact LCIA methodology and potentially to GLAM is it becomes available
  • derive and integrate uncertainty factors for consumption markets, based on the year-to-year trade variations
  • find and integrate more and more real production volumes instead of relying on rough estimates

Support

Contact maxime.agez@polymtl.ca

Citation

Citing the code: https://doi.org/10.5281/zenodo.11836125
Citing the article: https://doi.org/10.1007/s44498-026-00053-9
Citing BACI: Gaulier, G. and Zignago, S. (2010) BACI: International Trade Database at the Product-Level. The 1994-2007 Version. CEPII Working Paper, N°2010-23.

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

regioinvent-1.4.0.2.tar.gz (73.5 MB view details)

Uploaded Source

Built Distribution

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

regioinvent-1.4.0.2-py3-none-any.whl (73.6 MB view details)

Uploaded Python 3

File details

Details for the file regioinvent-1.4.0.2.tar.gz.

File metadata

  • Download URL: regioinvent-1.4.0.2.tar.gz
  • Upload date:
  • Size: 73.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regioinvent-1.4.0.2.tar.gz
Algorithm Hash digest
SHA256 2962a955fd9de74c20284e3008dcba247b989ed931c85c1af5c71dbf5a879469
MD5 bfa87a6e92e0df5598db5167b6514361
BLAKE2b-256 89861de5f195e525dfa727e84828786a0506339c36a02b1857537d61d7b4e620

See more details on using hashes here.

File details

Details for the file regioinvent-1.4.0.2-py3-none-any.whl.

File metadata

  • Download URL: regioinvent-1.4.0.2-py3-none-any.whl
  • Upload date:
  • Size: 73.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regioinvent-1.4.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8af70803cfa4678a1054a853bda4b8718e432bd9ed8619fd94312e1591d2dd94
MD5 8082404b80611fa2c537d14ac2497b7c
BLAKE2b-256 216e75b7ccae5e60686f114795d0e40503a2a434c1f421ef0209c7a41c45247e

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