Skip to content
All workCase study / Command-line tool

Python / Command-line utility

Hevy exporter

Your workout history, ready to use.

Choose a date range. Fetch the workouts. Write the detailed CSVs and a readable PDF report with one command.

hevy-export / usagepython

# Choose the period. Export the history.

python main.py --from 2025-01-01 --to 2025-05-28 --output-dir ./reports

# Output file patterns

*_sets.csv - one row per set

*_summary.csv - volume, muscle groups and PRs

*.pdf - workout log and charts

Usage example · from the documentation. This is a command example, not a captured run.
CSVindividual sets and summaries
PDFworkout log and charts
1command to run an export

I wanted my workout history in a format I could inspect and use outside Hevy. I built a small command-line tool that pulls it through the API, filters it by date and writes CSV files or a PDF report. It does one job without needing a dashboard around it.

The problem

An activity log is convenient inside an app. For a spreadsheet or a report, I need the underlying sets in a repeatable format and a way to choose the period I am looking at.

I wanted to ask for a date range once and get both the detailed rows and a readable summary from the same workout history.

What I built

The CLI reads a Hevy API key from the environment, fetches the workout history and writes the selected output files. Options choose the start date, end date, destination folder and whether to export CSV, PDF or both.

The set-level CSV keeps one row per set, with the date, exercise, weight, reps and RPE. A separate summary contains volume, muscle-group breakdowns and exercise PRs. The PDF adds a cover page, workout log and charts.

Output filenames include the requested period and a timestamp. That makes files from separate exports easier to tell apart.

Fetching the full history

The API returns workouts in pages. The client walks through them and applies the date filters while reading. Because the API returns newest first, it can stop when it passes the requested start date.

Authentication failures and timeouts produce an explicit error. If the API rate-limits a request, the client reads Retry-After, waits and retries, up to its configured attempt limit.

The export stage sorts the collected workouts chronologically before writing them. CSV-only mode does not load the PDF exporter, so a missing PDF dependency does not prevent a CSV export.

What I have now

One command produces the files I need for a chosen period. The detailed CSV is available for further analysis, while the report gives me a document I can read without opening a spreadsheet.

It is a small example of an API-to-file workflow: fetch a collection, shape the records and generate useful outputs. The same pattern fits recurring business reports, although this project uses my workout data rather than a client's system.

What it doesn't do

  • It needs a working Hevy API key and access to the API.
  • It runs on demand. There is no scheduler or background sync built into this tool.
  • Muscle groups are inferred from exercise names, so unusual or custom names can be classified imperfectly.
  • The date handling converts API timestamps to UTC. It does not have Loadout's configurable local-day grouping.

Have a similar workflow?

I build small API-to-file workflows for businesses that need recurring CSV exports or readable reports. If you have one in mind, write to me at luka@puhmeister.dev.