Skip to content
Engineering Decision Intelligence
TutorialVersion 0.4.1

openLCA IPC quickstart

Connect to openLCA, search the active database, and follow the basic calculation pattern.

Before you begin

  • openlca-ipc is installed
  • openLCA is running
  • the intended database is open
  • the IPC server is running

1. Connect

python
from openlca_ipc import OLCAClient

with OLCAClient(port=8080) as client:
    assert client.test_connection()
    print("Connected")

3. Start from a model you understand

For a first calculation, use an existing product system or process whose reference product and functional basis you can verify.

4. Run a calculation

python
result = client.calculate.simple_calculation(system, method)

try:
    impacts = client.results.get_total_impacts(result)
    for impact in impacts[:5]:
        print(impact["name"], impact["amount"], impact["unit"])
finally:
    result.dispose()

Warning

Always dispose calculation results when you are finished with them.

5. Inspect before rerunning

Use the same result for inventory inspection, contribution analysis, normalization, weighting, Sankey data, or exports where possible. This reduces the chance of silently analyzing a changed model.