Metadata-Version: 2.5
Name: strength-utils
Version: 0.1.1
Summary: Utilities for strength training: 1RM estimates, RPE/RIR tables, volume, progression, and simple program planning.
Author-email: benjaminmcf <mcfaddenben7@gmail.com>
License: MIT
License-File: LICENSE
Keywords: 1RM,RPE,fitness,powerlifting,strength,training
Requires-Python: >=3.11
Requires-Dist: sqlalchemy>=2.0
Description-Content-Type: text/markdown

# strength-utils

Please note that this package is undergoing regular changes. 

Typed utilities for strength training and programming.

## Features
- Multiple 1RM estimation formulas (Epley, Brzycki, Lombardi, Mayhew).
- Predict training weight at target reps or RPE.
- RPE ↔ %1RM tables (with interpolation).
- Volume/tonnage calculations per exercise and per session.
- Basic progression helpers (linear, double progression, RIR-based).
- Simple templated programs (e.g., 5x5, PPL) as typed data models.
- Unit conversion utilities (kg/lb).
- 100% type-hinted code.
- SQL persistence for workouts and session plans (SQLite by default, PostgreSQL-ready).

## Quickstart

```python
from strength_utils import estimate_1rm, predict_weight_for_reps, rpe_to_percent

one_rm = estimate_1rm(weight=140.0, reps=5, method="epley")  # ~163.3 kg
target = predict_weight_for_reps(one_rm, reps=3, rpe=9.0)    # planned training weight
print(one_rm, target)
```

## License
MIT


## Percent tables per lift

```python
from strength_utils import make_percent_table_by_lift
tables = make_percent_table_by_lift({"Back Squat": 180.0, "Bench Press": 120.0})
print(tables["Back Squat"][0.8])  # -> 1RM * 0.8 rounded to nearest 2.5 kg
```

## Program generators (PPL & 5x5)

```python
from strength_utils import program_ppl, program_5x5
ppl = program_ppl()            # 3-day template
five = program_5x5(weeks=4)    # 12 sessions (3 per week)
for s in ppl:
    print(s.day, s.workout.name, len(s.workout.prescriptions))
```

## SQL storage

```python
from strength_utils import StrengthDatabase, plan_workout
from strength_utils import Exercise, SetPrescription, SetScheme, SessionPlan, Workout

db = StrengthDatabase()  # sqlite:///strength_utils.db by default

squat = Exercise("Back Squat", ("quads", "glutes"))
presc = SetPrescription(squat, sets=5, scheme=SetScheme(reps=5, rpe=8.0))
workout = Workout("Heavy Day", [presc])

db.store_workout(workout)
plan = plan_workout(workout, {"Back Squat": 180.0})
session = SessionPlan(day="2024-01-01", workout=workout)
db.store_session_plan(session, plan)

# Retrieve later
saved_session, saved_plan = db.get_session_plan("2024-01-01")

# Supply a PostgreSQL URL when needed:
# db = StrengthDatabase(url="postgresql+psycopg://user:pass@host/dbname")
```
