The idea is to develop a “fitness tracking utility” (i.e. Strava/Runkeeper) based on org format. I started development mainly to learn a bit of Elisp and because I was disappointed by the switch to closed source license of Runalyze. For now it is just a small prototype
The architecture consists of three components:
- org-mode (actually the org-mode text format) to store data in human readable format. Org-mode format will play the same role of maildir for mu4e and ledger files for ledger.
- a command line utility (server) to process and index org-mode files. This plays the same role of mmu for mu4e and ledger
- a user interface (GUI) to present graph and statistics produced via the server
For now I’m only working on gym notes: i.e. notes taken while training in the gym. The idea is to have functionalities on par with https://play.google.com/store/apps/details?id=com.github.jamesgay.fitnotes&hl=en
Each workout is a top-level entity. The second string of the entity title must be a date in format YYYY-MM-DD. The date will probably become a property of the entity.
* Workout :PROPERTIES: :date: 2018-01-24 :END:
Each exercise is a sub-entity of a workout entity. An exercise can have the following optional properties :
- name; it’s the name of the entity
- muscle: a string to identifying the type of exercise. E.g Cardio, Abs, Legs.
- duration: duration of the exercise in format hh:mm:ss
- distance: distance in meters, i.e. 3200.0 m
** Rowing Machine :PROPERTIES: :muscle: Cardio :duration: 0:15:39 :distance: 3200.0 m :END:
** Crunch Machine :PROPERTIES: :muscle: Abs :END:
An exercise can have multiple sets. Sets are expressed as a - list.
- 11.0 kgs x 10 reps - 11.0 kgs x 15 reps - 11.0 kgs x 15 reps
Weight property for sets is optional
- 10 reps - 15 reps - 15 reps
You can find a complete example in example.org
The server is implemented via a small command line python utility in
cli/cly.py.
The server has a prompt, which allows to load org-files (and in future
indexes) and process them without need of reloading them for each
invocation.
The server supports the following commands
import csvfile orgfileConverts a CSV file exported by fitnotes Android app to org-fit formatquitQuit the programload_org orgfileLoads an org-fit filelist_musclesList the tags used to classify exercisesgraph value groupby months muscle filenameproduces a linear graph from the loaded fit filevalueis the value displayed and can becount(number of exercises),sets(number of sets),reps(total number of repetitions),volume(weight x reps)groupsbyis the resolution of thexaxis and can beday,week, ormonthmonthsis the interval of thexaxis and can beall(no limit) or an integer representing the number of monthsmusclefilters the exercises and can beallor one of the strings used to tag the exercises (i.e. Chest)filenamefilename of the produced png
The server uses pandas, numpy, matplotlib, and orgparser
The GUI consists of an org-file where you can add graph and statistics and emacs functions defined in emacs/gym.el.
There are three variables to customize:
org-fit-data-filefull-path of your org-fit fileorg-fit-export-pathfull-path of the directory used to produce the graphsorg-fit-cli-execfull-path ofcli.py
Open an org file like analysis.org. This is your main GUI. Graph are produced by manipulating org-babel snippets.
- To start the org-fit execute
org-fit-start. - To add a graph for historical data execute
org-fit-add-graph-history - To add a table for historical data execute
org-fit-add-table-summary - To add a pie chart graph execute
org-fit-add-graph-breakout - To add a table for breakout data execute
org-fit-add-table-breakout - You can update a graph by moving the cursor in the corresponding
org-babel fragment and use the following keybinding
C-q 1display volume (i.e. kg * reps)C-q 2display repsC-q 3display max weightC-q 4display setsC-q 5display max repsC-q 6display 1RM Epley formulaC-w 1group per monthC-w 2group per weekC-w 3group per dayC-e 1limit results to last monthC-e 2limit results to two monthsC-e 3limit results to three monthsC-e 6limit results to six monthC-e 0no time limitC-e efilter per exerciseC-e 0filter per muscle
- breakout graph per exercise
- selection of time range for breakout graph
- Import/merging
- Compute additional data per workout

