Python scripts for automating openLCA calculations using the IPC server. Built by Below280 as part of our openLCA scripting knowledge base.
Each tool is in its own folder with its own README and example files.
IPC_hello_world - Connection check. Confirms Python can talk to your openLCA instance.
openLCA-scenarios - Scenario calculations. Reads parameter values from a CSV (one column per scenario), runs each one, and writes all impact results to a single output file.
openLCA-sensitivity - Sensitivity analysis. Varies each parameter individually by a fixed percentage above and below its baseline, and writes the results to CSV.
openLCA-parameters - Parameter pull. Exports global, local, or product system parameters to CSV for inspection or as a starting point for scenario and sensitivity files.
prospective-electricity - Electricity market parameterisation. Converts fixed ecoinvent electricity mix values into named parameters, enabling prospective LCA across the full supply chain.
- Install the packages:
pip install olca-ipc - Open your database in openLCA
- Go to Tools > Developer Tools > IPC Server, leave the port as 8080, click the green play button
- Run a script from its folder
All scripts accept --help for full usage details (except hello, which has nothing to configure).
The openLCA-parameters tool is a good starting point: it pulls all the parameters in your database or product system to CSV, so you can see what is available before building a scenario or sensitivity file.
The prospective tool prepares an ecoinvent database by converting fixed electricity mix values into named parameters. The openLCA-scenarios tool then runs calculations with overridden parameter values from a CSV. A typical prospective LCA workflow:
- Run
B280_olca_elec_parameterise.pyon a copy of your ecoinvent database. - Run
B280_olca_parameters.py -p "My System"to see the available parameters. - Build a scenario CSV with projected electricity mixes.
- Run
B280_olca_scenarios.pywith that CSV against your product system.
The openLCA-sensitivity tool is independent and works on any parameterised model.
Full guides covering setup, parameters, and how these scripts work are in the Below280 openLCA Scripting knowledge base.
- openLCA 2.x with IPC server enabled
- Python with
olca-ipcandolca-schemapackages
Below280 uses openLCA's IPC server extensively in our LCA and EPD work. These scripts are drawn from that experience. If you are interested in openLCA training or need help with your LCA projects, get in touch.
For issues: info@below280.com