Metadata-Version: 2.4
Name: materia-epd
Version: 0.7.4
Summary: Aggregate and normalize Environmental Product Declaration (EPD) datasets.
Author: pbaustert, tngTUDOR, glarreag, killileg
License-Expression: MIT
Project-URL: Homepage, https://github.com/pbaustert/materia-epd
Project-URL: Documentation, https://materia-epd.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/pbaustert/materia-epd
Project-URL: Issues, https://github.com/pbaustert/materia-epd/issues
Project-URL: Changelog, https://materia-epd.readthedocs.io/en/latest/changelog.html
Keywords: epd,ilcd,lca,life-cycle-assessment,environmental-product-declaration,sustainability
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: <3.13,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: click
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pycountry
Requires-Dist: comtradeapicall
Requires-Dist: rich>=14.3.2
Requires-Dist: structlog>=25.5.0
Requires-Dist: matplotlib
Requires-Dist: reportlab
Provides-Extra: dev
Requires-Dist: black==23.9.1; extra == "dev"
Requires-Dist: flake8==6.1.0; extra == "dev"
Requires-Dist: pytest==7.4.2; extra == "dev"
Requires-Dist: pytest-cov==4.1.0; extra == "dev"
Requires-Dist: pre-commit==3.4.0; extra == "dev"
Requires-Dist: deptry; extra == "dev"
Requires-Dist: coverage-badge; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: setuptools>=82.0.0; extra == "dev"
Dynamic: license-file

# Generic EPD Aggregator

[![Build](https://github.com/pbaustert/materia-epd/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/pbaustert/materia-epd/actions/workflows/ci.yml)
![Coverage](https://raw.githubusercontent.com/pbaustert/materia-epd/main/coverage.svg)
[![PyPI](https://img.shields.io/pypi/v/materia-epd.svg)](https://pypi.org/project/materia-epd/)
[![Python](https://img.shields.io/pypi/pyversions/materia-epd.svg)](https://pypi.org/project/materia-epd/)
[![Documentation](https://readthedocs.org/projects/materia-epd/badge/?version=latest)](https://materia-epd.readthedocs.io/en/latest/)
[![License](https://img.shields.io/github/license/pbaustert/materia-epd)](https://github.com/pbaustert/materia-epd/blob/main/LICENSE.txt)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://pre-commit.com/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Flake8](https://img.shields.io/badge/linting-flake8-blue)](https://flake8.pycqa.org/en/latest/)

---

# 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:

```console
pip install materia-epd
```

Requires Python 3.10+.

---

## Documentation

Full documentation is hosted on [Read the Docs](https://materia-epd.readthedocs.io/en/latest/).

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

---

## Usage
Here’s a minimal example:

```console
python -m materia_epd <generic_processes_dir> <epd_processes_dir> -o <output_dir> -v
```

Note that you need to point to the root `processes` folders and need to provide a `matches` folder in the generic data folder to link generic products and EPDs.
Add the flag `--v` or `-v` for verbosity. Logs files with details will be automatically created in `<output_dir>`.
The `<generic_processes_dir>` folder should be structured like this:

```
<generic_process_dir>
├── flows
│   ├── <flow-uuid-1>.xml # Reference flow of EPD-uuid-1
│   ├── <flow-uuid-2>.xml
│   └── ...etc
├── matches
│   ├── <matches-uuid-1>.json # Source EPDs for EPD-uuid-1
│   ├── <matches-uuid-1>.json
│   └── ...etc
├── PDFs
├── processes
│   ├── <EDP-uuid-1.xml> # Ready-to-fill skeleton file specific for EPD-uuid-1
│   ├── <EDP-uuid-2.xml>
│   └── ...etc
└── templates
    ├── GenPro_template.xml # Template with the EPD schema
    └── GenRef_template.xml # Template with the flow schema

```

The `<epd_process_dir>` should have a structure like this:

```
<epd_process_dir>
├── flows # Contains all reference flows of all processes
└── processes # Contains all the potential source EPDs

```

The `.json` files are named after corresponding generic products and should be structured as follows:


```json
{
  "type": "<aggregation_type>",  // "average" or "assembled"
  "uuids": [
    "<uuid-1>",
    "<uuid-2>",
    "<uuid-3>",
    "... more UUIDs ..."
  ]
}

```
where the provided uuids link to the process files of the EPDs that match.

---

## Development / running tests

See [DEVELOP.md](DEVELOP.md) for local setup, versioning, and PyPI release instructions.

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

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

Then run tests:

```console
pytest
```
