Introduction

This is a guide to automating openLCA: doing in seconds, with a few lines of instructions, what would otherwise be an afternoon of clicking — bulk edits, calculations across many systems, custom exports. It does assume some basic programming knowledge — the examples are written in Python, so a little prior experience with Python (or any language) will make them much easier to follow.

To start right away, go to the Quickstart.

What you can do with it

Common uses include:

  • Calculate many product systems at once and write the results to a single spreadsheet, rather than running and exporting them individually. (Batch calculate to Excel)
  • Test sensitivity by running a system repeatedly with different parameter values. (Sensitivity analysis)
  • Edit data in bulk — rename, recategorize, or correct the same field across hundreds of processes in a single pass. (Update a process)
  • Build models from a spreadsheet, creating flows, processes, and product systems from existing data. (Create a flow, a process, a product system)
  • Produce custom reports in the layout you need. (Excel automation)

Is this the right tool for me?

You write your scripts in an editor built into openLCA, so there is nothing to install. openLCA includes Python (called Jython) and runs your scripts directly.

If you are an experienced Python developer, you may prefer openLCA's IPC API, which lets you control openLCA from your own Python installation.

Before you start

Scripts write directly to your database, creating, editing, and deleting datasets, and those changes are not easily undone. Work on a copy of your database until you are confident that a script behaves as intended.

The Quickstart covers writing and running your first script.