Generic EPD Aggregator

Build Coverage PyPI Python Documentation License pre-commit Code style: black Flake8


Features

  • Parse ILCD process and flow XMLs

  • Normalize material properties and LCIA modules

  • Aggregate impacts and compute weighted averages

  • Write new ILCD XML datasets


Installation

Install via PyPI:

pip install materia-epd

Requires Python 3.10+.


Documentation

Full documentation is hosted on Read the Docs.

It covers the EPD pipeline, module reference, contributing guidelines, and the changelog.


Usage

Run the aggregator

python -m materia_epd <generic_processes_dir> <epd_processes_dir> -o <output_dir> -v
  • <generic_processes_dir> — root folder for skeleton generic products (see Input folder layout).

  • <epd_processes_dir> — root folder for source EPDs (see Input folder layout).

  • -o <output_dir> — where aggregated ILCD outputs and reports are written.

  • -v — verbose logging. Log files are created in <output_dir> when an output path is set.

You need a matches folder under the generic folder to link each generic product to its source EPDs (see Matches JSON).

EPD cache

Source EPDs can be cached so later runs avoid re-parsing every XML file.

Default behaviour: on the first aggregator run, the tool builds a cache at ./.materia_epd_cache/ in the current working directory, then continues. Subsequent runs load from that cache when it is still valid.

Pre-build the cache (optional, without running the pipeline):

python -m materia_epd build-cache <epd_processes_dir> [-o <cache_dir>] [--force] [--workers N] [-v]

Flag

Description

-o <cache_dir>

Cache directory (default: ./.materia_epd_cache/)

--force

Rebuild even if the cache is already valid

--workers N

Parallel extraction workers (default: CPU count)

-v

Verbose logging

Aggregator cache flags:

Flag

Description

--epd-cache <dir>

Use a custom cache directory instead of the default

--no-epd-cache

Skip the cache and parse source EPD XML on every run

Input folder layout

Generic products (<generic_processes_dir>)

<generic_process_dir>
├── flows
│   ├── <flow-uuid-1>.xml   # Reference flow of generic-uuid-1
│   ├── <flow-uuid-2>.xml
│   └── ...
├── matches
│   ├── <generic-uuid-1>.json   # Source EPDs for generic-uuid-1
│   ├── <generic-uuid-2>.json
│   └── ...
├── PDFs
├── processes
│   ├── <generic-uuid-1>.xml   # Skeleton process for generic-uuid-1
│   ├── <generic-uuid-2>.xml
│   └── ...
└── templates
    ├── GenPro_template.xml # Template with the EPD schema
    └── GenRef_template.xml # Template with the flow schema

Source EPDs (<epd_processes_dir>)

<epd_process_dir>
├── flows       # Reference flows for all source EPDs
└── processes   # All potential source EPD process XMLs

Matches JSON

Files in matches/ are named after the corresponding generic product UUID:

{
  "type": "<aggregation_type>",
  "uuids": [
    "<uuid-1>",
    "<uuid-2>",
    "<uuid-3>",
    "... more UUIDs ..."
  ]
}

type is "average", "market-average", or "assembled". The uuids list links to process files in the source EPD processes/ folder.


Development / running tests

See DEVELOP.md for local setup, versioning, and PyPI release instructions.

For local development, install the package in editable mode with developer dependencies:

python -m pip install -e ".[dev]"

Then run tests:

pytest

Indices and tables