Metadata-Version: 2.4
Name: pypeh
Version: 0.3.3
Summary: A modular project with a core library and multiple adapters
Author: VITO Health DMT
License-Expression: MIT
License-File: LICENSE
Requires-Python: <4.0.0,>=3.10
Requires-Dist: fsspec
Requires-Dist: linkml-runtime>=1.9.1
Requires-Dist: peh-model<0.6.0,>=0.5.3
Requires-Dist: pydantic-settings
Requires-Dist: python-ulid>=3.1.0
Provides-Extra: compehndly
Requires-Dist: compehndly>=0.0.1a2; extra == 'compehndly'
Provides-Extra: core
Provides-Extra: dataframe-adapter
Requires-Dist: fastexcel; extra == 'dataframe-adapter'
Requires-Dist: pandera>=0.27.0; extra == 'dataframe-adapter'
Requires-Dist: peh-dataguard<1.0,>=0.4; extra == 'dataframe-adapter'
Requires-Dist: polars; extra == 'dataframe-adapter'
Requires-Dist: pyarrow; extra == 'dataframe-adapter'
Provides-Extra: export-adapter
Requires-Dist: xlsxwriter; extra == 'export-adapter'
Provides-Extra: polars-adapter
Requires-Dist: fastexcel; extra == 'polars-adapter'
Requires-Dist: polars; extra == 'polars-adapter'
Requires-Dist: pyarrow; extra == 'polars-adapter'
Provides-Extra: rocrate-adapter
Requires-Dist: rocrate; extra == 'rocrate-adapter'
Provides-Extra: s3-adapter
Requires-Dist: s3fs; extra == 's3-adapter'
Provides-Extra: test-core
Requires-Dist: pytest<9,>=8.2.0; extra == 'test-core'
Provides-Extra: test-dataframe
Requires-Dist: numpy; extra == 'test-dataframe'
Requires-Dist: scipy>=1.15.3; extra == 'test-dataframe'
Description-Content-Type: text/markdown

# pypeh

`pypeh` is a lightweight ETL and data-ops toolkit for **Personal Exposure and Health (PEH)** data.

It helps you:
- work with PEH-model resources in Python
- load/transform/validate PEH study data
- support **FAIR** data workflows (findable, accessible, interoperable, reusable)

The toolkit is built to interact with the PEH model from PARC:
- https://github.com/eu-parc/parco-hbm

## Install

Core package:
```bash
uv pip install pypeh
```

With dataframe adapter extras (Polars-based workflows):
```bash
uv pip install "pypeh[dataframe-adapter]"
```

## Basic Usage

```python
from pypeh import Session

# Start a session
session = Session()
# Load PEH model resources (e.g. YAML configs) into cache
session.load_persisted_cache(source="config")
# Load tabular data as a DatasetSeries using a DataImportConfig from cache
data_import_config = session.cache.get("<data_import_config_id>", "DataImportConfig")
dataset_series = session.load_tabular_dataset_series(
    source="my_data.xlsx",
    data_import_config=data_import_config,
)
```

From there you can use adapters for:
- validation
- enrichment (derived variables)
- aggregation
- export/persistence

## Run Tests

```bash
make test-core
make test-dataframe
make test-rocrate
```

## Documentation

Build the static documentation site with MkDocs:

```bash
make docs
```

Preview it locally:

```bash
make docs-serve
```
