Skip to main content

A lightweight health data analytics tool for monthly time-series visualization and distribution analysis.

Project description

๐Ÿ“˜ rr2graph โ€” Visualize Blood Pressure, Pulse, and Weight Data

PyPI Version Python Versions Downloads

CI Status Coverage

License Release Code Style: Black

GHCR Docker Pulls Docker Image

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

Format: A4 Landscape (11.69 ร— 8.27 inch)

The CLI prints all generated files:

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

๐Ÿ 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

โšก Python Quickstart with uv (End User)

If you prefer using the modern Python tool uv:

๐Ÿ‘‰ uv Quickstart

๐Ÿš€ 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

    pipenv install -e .
    

    This installs:

    • the rr2graph package (editable mode)
    • all dependencies defined in pyproject.toml
  3. Optional: Development dependencies

    pipenv install -r requirements_dev.txt
    

๐Ÿงฐ CLI Usage

After installation, the command rr2graph becomes available.

Show help:

rr2graph --help
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

rr2graph -g

Creates:

test_rr_data.xlsx

with realistic blood pressure, pulse, and weight data.

โ„น๏ธ System & Configuration Info

rr2graph --info

Example output:

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:

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:

rr2graph -c config.yaml

๐Ÿ“Š Output Structure

Running:

rr2graph -c config.yaml

produces:

plots/
โ”œโ”€โ”€ png/
โ”œโ”€โ”€ pdf/
โ””โ”€โ”€ svg/

๐Ÿ“ Project Structure

/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

pipenv run pytest

๐Ÿ›  Troubleshooting

โŒ UnicodeDecodeError in YAML

You likely passed an Excel file as --config.

Correct:

rr2graph -c config.yaml

Incorrect:

rr2graph -c test_rr_data.xlsx

โŒ CLI command not found

Reinstall:

pipenv install -e .

๐Ÿ‘จโ€๐Ÿ’ป Developer Notes

Version bumping is handled via:

make version-patch
make version-minor
make version-major

TestPyPI upload:

make publish-test

Build artifacts:

make build

Manpage installation:

make install-man
make man

๐Ÿ“„ License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rr2graph-0.3.2.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rr2graph-0.3.2-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file rr2graph-0.3.2.tar.gz.

File metadata

  • Download URL: rr2graph-0.3.2.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rr2graph-0.3.2.tar.gz
Algorithm Hash digest
SHA256 775bd7ca25da9828cfb39232f7c0e3e0bb2bdf7569fa9d24e8b1d60236dc0f3c
MD5 7f3a934c71b5b3e169b674cc5d21a1a6
BLAKE2b-256 6b22aa0f2f984904655a7d28d8c2b1e1cd73c3f4652a622b6c75e35e1fa99d0d

See more details on using hashes here.

File details

Details for the file rr2graph-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: rr2graph-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rr2graph-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 89f384aaa26e99107c064dc15c7e8c5a9920429b6534678e003e78e0462a5f72
MD5 905357a95e9c8d52a8576293b6c120e2
BLAKE2b-256 494186d70d5b08f2e198ccb9852f8360fbccaad960aebe8f0fe28b3b3cab1162

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page