Metadata-Version: 2.4
Name: rr2graph
Version: 0.3.2
Summary: A lightweight health data analytics tool for monthly time-series visualization and distribution analysis.
Author: Hagen
License: MIT
Project-URL: Homepage, https://github.com/hlotze/rr2graph
Project-URL: Repository, https://github.com/hlotze/rr2graph
Project-URL: Issues, https://github.com/hlotze/rr2graph/issues
Project-URL: Documentation, https://github.com/hlotze/rr2graph#readme
Project-URL: Changelog, https://github.com/hlotze/rr2graph/releases
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: matplotlib
Requires-Dist: seaborn
Requires-Dist: pyyaml
Requires-Dist: openpyxl
Requires-Dist: xlsxwriter
Dynamic: license-file

# 📘 rr2graph — Visualize Blood Pressure, Pulse, and Weight Data

[![PyPI Version](https://img.shields.io/pypi/v/rr2graph)](https://pypi.org/project/rr2graph/)
![Python Versions](https://img.shields.io/pypi/pyversions/rr2graph)
![Downloads](https://img.shields.io/pypi/dm/rr2graph)

![CI Status](https://github.com/hlotze/rr2graph/actions/workflows/python-ci.yml/badge.svg)
[![Coverage](https://codecov.io/gh/hlotze/rr2graph/branch/main/graph/badge.svg)](https://codecov.io/gh/hlotze/rr2graph)

![License](https://img.shields.io/badge/license-MIT-green)
![Release](https://img.shields.io/github/v/release/hlotze/rr2graph)
![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)

[![GHCR](https://img.shields.io/badge/GHCR-rr2graph-blue?logo=github)](https://github.com/hlotze/rr2graph/pkgs/container/rr2graph)
![Docker Pulls](https://img.shields.io/badge/GHCR%20Pulls-Automatic-blue?logo=docker)
![Docker Image](https://img.shields.io/badge/Multi--Arch-AMD64%20%7C%20ARM64-green?logo=docker)

`rr2graph` is a lightweight command-line tool for processing and visualizing blood pressure, pulse, and weight data stored in Excel files.  
It generates monthly plots (box-swarm, scatter, histogram, violin) and exports them automatically as PNG, PDF, and SVG.

## 📤 Example Output

Example visualization using scatter and box-swarm plots:

![Example Box Swarm Plot](https://github.com/hlotze/rr2graph/blob/main/examples/example_box_swarm.png?raw=true)

Format: **A4 Landscape (11.69 × 8.27 inch)**

The CLI prints all generated files:

```text
Heart rows read: 81
Weight rows read: 49
→ Excel file: rr_data.xlsx
→ Months: 3
→ Output folder: plots/
Generating histogram plots…
Generated histogram plots stored at:
– plots/png/(2026-02__2026-04 3 months) per month data and histogram.png
– plots/pdf/(2026-02__2026-04 3 months) per month data and histogram.pdf
– plots/svg/(2026-02__2026-04 3 months) per month data and histogram.svg
…
```

## 🐳 Docker Quickstart (End User)

If you want to use rr2graph without installing Python locally, see the full guide here:

👉 [Docker Quickstart](./README_DOCKER.md)

## 🐍 Python Quickstart (Virtual Environment, End User)

If you want to run rr2graph locally in an isolated Python environment, see the step-by-step guide here:

👉 [Virtual Environment Quickstart](./README_VENV.md)

## ⚡ Python Quickstart with uv (End User)

If you prefer using the modern Python tool uv:

👉 [uv Quickstart](./README_UV.md)

## 🚀 Installation

This project supports Pipenv-based installation.

1. Ensure you are in the project root

    > ~/your/project/directory/

2. Install in editable mode using Pipenv

    ```bash
    pipenv install -e .
    ```

    This installs:
    - the rr2graph package (editable mode)
    - all dependencies defined in pyproject.toml

3. Optional: Development dependencies

    ```bash
    pipenv install -r requirements_dev.txt
    ```

## 🧰 CLI Usage

After installation, the command `rr2graph` becomes available.

Show help:

```bash
rr2graph --help
```

```text
usage: rr2graph [-h] [-e EXCEL] [-n NUM_OF_MONTHS] [-o OUTPUT] [-c CONFIG] [-v] [-g] [-i]

Reads Excel data and generates plots.

options:
  -h, --help            Show help and exit
  -e, --excel EXCEL     Path to Excel file (default: rr_data.xlsx)
  -n, --num_of_months NUM_OF_MONTHS
                        Number of months 1–6 (default: 3)
  -o, --output OUTPUT   Output folder for generated plots (default: plots/)
  -c, --config CONFIG   Optional YAML configuration file
  -v, --version         Show program version and exit
  -g, --generate-test-data
                        Generate test_rr_data.xlsx and exit
  -i, --info            Show system and configuration information
```

## 🧪 Generate Test Data

```bash
rr2graph -g
```

Creates:

> test_rr_data.xlsx

with realistic blood pressure, pulse, and weight data.

## ℹ️ System & Configuration Info

```bash
rr2graph --info
```

Example output:

```text
rr2graph info
──────────────────────────────────────────────
Version:        1.1.0
Python:         3.11.15
Installed at:   /opt/homebrew/lib/python3.11/site-packages/rr2graph

Working dir:    /Users/your_user/rr2graph_test
System:         Darwin 25.3.0 (arm64)
Terminal:       utf-8

No config file found (config.yaml missing).
──────────────────────────────────────────────
Everything looks good ✓
```

## 📝 Configuration File (YAML)

Example config.yaml:

```yaml
excel: "rr_data.xlsx"
num_of_months: 3
output: "plots/"
```

| Field | Description |
| ----- | ----------- |
| excel | Path to the Excel file containing RR data |
| num_of_months | Number of months to analyze |
| output | Output directory for PNG/PDF/SVG plots |

Use it via:

```bash
rr2graph -c config.yaml
```

## 📊 Output Structure

Running:

```bash
rr2graph -c config.yaml
```

produces:

```text
plots/
├── png/
├── pdf/
└── svg/
```

## 📁 Project Structure

```text
/your/project/directory/
.
├── CHANGELOG.md
├── coverage.ini
├── Dockerfile
├── examples
│   └── example_box_swarm.png
├── LICENSE
├── Makefile
├── man
│   ├── install-man.sh
│   ├── rr2graph.1
│   └── uninstall-man.sh
├── MANIFEST.in
├── Pipfile
├── Pipfile.lock
├── plots
├── pyproject.toml
├── pytest.ini
├── README_DOCKER.md
├── README_UV.md
├── README_VENV.md
├── README.md
├── requirements_dev.txt
├── requirements.txt
├── rr2graph
│   ├── __init__.py
│   ├── cli.py
│   ├── helpers.py
│   ├── io.py
│   ├── layout.py
│   ├── monthly.py
│   ├── orchestrator.py
│   ├── plots
│   │   ├── __init__.py
│   │   ├── box_swarm.py
│   │   ├── hist.py
│   │   ├── scatter.py
│   │   └── violin.py
│   └── tools
│       ├── __init__.py
│       └── bump_version.py
└── tests
    ├── conftest.py
    ├── README.md
    ├── test_cli.py
    ├── test_helpers.py
    ├── test_io.py
    ├── test_layout.py
    ├── test_monthly.py
    ├── test_orchestrator.py
    ├── test_plots.py
    └── tools
        └── test_bump_version.py
```

## 🧪 Run Tests

```bash
pipenv run pytest
```

## 🛠 Troubleshooting

❌ UnicodeDecodeError in YAML

You likely passed an Excel file as --config.

Correct:

```bash
rr2graph -c config.yaml
```

Incorrect:

```bash
rr2graph -c test_rr_data.xlsx
```

❌ CLI command not found

Reinstall:

```bash
pipenv install -e .
```

## 👨‍💻 Developer Notes

Version bumping is handled via:

```text
make version-patch
make version-minor
make version-major
```

TestPyPI upload:

```text
make publish-test
```

Build artifacts:

```text
make build
```

Manpage installation:

```text
make install-man
make man
```

## 📄 License

MIT
