Skip to main content

BRRAG — Botha's Road Running Age Grading

Age grading on the USATF MLDR 2025 road tables. The Python package, the CLI and the PyPI distribution are called brrag; the repository keeps its name and URL.

check

Reference documentation and a verified implementation of road-running age grading on the USATF Masters Long Distance Running (MLDR) 2025 tables.

You give it a sex, an age, a distance and a time. It tells you the age-graded time and the age grade percentage — one number that lets a 12-year-old's 5 km and a 72-year-old's marathon be compared on the same scale.

$ brrag 40:00 --age 40 --sex M --distance 10k
factor             0.9636
age-graded        38:32.6
age grade           68.49%

$ brrag 32:00 --age 65 --sex M --distance 10k
factor             0.7761
age-graded        24:50.1
age grade          106.30%      # above 100% = better than the age standard

Install

$ pip install brrag
$ brrag 40:00 --age 40 --sex M --distance 10k

Stdlib-only, no dependencies, and the wheel carries its own tables so it works offline. Versions come from the git tag; see docs/11-releasing.md.

Where to start

If you want to… Read
Understand the idea and the numbers docs/01-concepts.md
See what the 2025 tables contain docs/02-tables-2025.md
Grade a time (the algorithm) docs/03-algorithm.md
Know how the tables were built docs/04-methodology.md
Trust or audit the data docs/05-provenance.md
Handle weird inputs docs/06-edge-cases.md
Write your own implementation docs/07-implementation.md
Check our claims docs/08-validation.md
Know the revision history / what 2026 needs docs/09-history.md
Grade a whole club in Excel docs/10-excel-addin.md
Release or publish a version docs/11-releasing.md

Full index: docs/index.md.

Quick use (Python)

from brrag import table, format_time

t = table(2025, "M")                       # or table(2025, "F")
g = t.grade("M", 40, 40 * 60, dist_km=10)  # 40:00 for 10 km at age 40
print(g.factor, g.percent)                 # 0.9636  68.49
print(format_time(g.age_graded_s))         # 38:32.6

No dependencies outside the standard library for the library itself (openpyxl is only needed by the table-extraction and verification tools).

In Excel

xll/road_running_age_grading.xll is a native add-in for grading a whole squad at once:

=RRAG.GRADE(B2:B181, C2:C181, D2:D181, E2:E181)     180 age grades, spilled
=RRAG.BLOCK(B2:B181, C2:C181, D2:D181, E2:E181)     factor, standards, graded time, percent

Four editions are compiled in (2025/2020/2015/2010), the fifth argument selects one or names a custom <name>.csv table, and a range passed there is used as an ad-hoc table. Build and install: xll/README.md; design notes: docs/10-excel-addin.md.

Getting started

$ git clone https://github.com/igitur/road-running-age-grading.git
$ cd road-running-age-grading
$ make setup          # .venv + openpyxl/oletools/pypdf
$ make check          # the full validation suite

The repo ships data/mldr_road.json, so the library and CLI work immediately with nothing but Python 3.10+. make fetch downloads the two source artefacts and clones the upstream tables repository when you want checks B and C to run (after a fresh clone they are already present, since the artefacts are committed).

Layout

data/mldr_road.json        2025 (+2020/2015/2010) factors, extracted and hashed
data/source_sha256.txt     hashes of every source artefact we read
brrag/                   reference implementation (core.py, ui.py, cli.py)
tools/extract_tables.py    pull factor tables out of the calculator page -> JSON
tools/js_oracle.js         run the *published calculator's own JS* under Node
tools/verify.py            three-way validation harness (A/B/C)
tools/reproduce_curve.py   rebuild each factor curve from its 10 fitted parameters
tools/render_wiki.py       docs/*.md -> wiki/*.html (no JS, no CDN)
xll/                       native Excel add-in: columns in, age grades out
docs/                      the documentation set (Markdown; source of truth)
page.html                  archived copy of the calculator page we read
MLDRRoadFactors2025.xlsm   archived copy of the official factors workbook (VBA)

Generated or fetched, not committed: wiki/ (make wiki), raw/ (make unpack), repo/ and notes/ (make fetch + pypdf).

make help lists the tasks; make all re-downloads the sources, re-extracts the data, validates it, reproduces the curves and re-renders the wiki.

Verify it

$ make check
A. exact-event grid: 4224 lookups, 0 mismatches
B. JS oracle: 1412 requests, 0 mismatches, worst percent delta 0.000000 pp
C. standards file: 4224 cells, 0 mismatches, 18 known anomalies
RESULT: PASS
worst absolute error across the curves that match exactly: 0.0001
links: 0 problem(s)

Details and what each check catches: docs/08-validation.md.

Reading it as a wiki

The Markdown in docs/ is the source of truth — it versions with the data, diffs cleanly, and renders on GitHub. If you would rather click through it, render the HTML copy and serve it:

$ .venv/bin/python tools/render_wiki.py      # writes wiki/*.html

Twelve self-contained pages, a sticky sidebar, no JavaScript, no CDN, no build step beyond that one command — which is why it drops straight into the existing Caddy static-site setup if you want it online.

Status of the tables

The 2025 road tables were approved by the USATF MLDR Council on 2025-01-10; the published workbooks are dated 2025-07-27. The tables are re-fitted roughly every five years (2010 → 2015 → 2020 → 2025), so treat 2025 as current and expect a 2030 revision. Everything in this repo is pinned to the published 2025 artefacts by SHA-256 — see docs/05-provenance.md.

One caveat worth knowing up front: the working spreadsheets shipped in the upstream repo (maleRoad2025.xlsx, dated 2025-07-25) do not reproduce the published male 5 km / 10 km curves. The published factor workbook, the calculator and the …Std2025.xlsx standards files all agree with each other; the male working file is one revision behind. docs/05-provenance.md has the numbers.

Licence / attribution

Tables compiled by Alan Jones (alanjones@grests.com) with single-age bests by Tom Bernhard; approved by the USATF MLDR Council. Calculator by Howard Grubb (howardgrubb.co.uk). Upstream repository: https://github.com/AlanLyttonJones/Age-Grade-Tables. Cite the upstream tables, not this repo, when publishing results.

Metadata

Release files for brrag 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brrag 0.0.5
File Size Uploaded Provenance Actions
brrag-0.0.5.tar.gz 365.5 kB With provenance Details for brrag-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brrag 0.0.5
File Interpreter ABI Platform Actions
brrag-0.0.5-py3-none-any.whl Python 3 none any Details for brrag-0.0.5-py3-none-any.whl

Total release size: 404.4 kB

Release files / brrag-0.0.5.tar.gz

Download URL brrag-0.0.5.tar.gz
Size 365.5 kB
Tags Source
SHA-256 checksum
How to use checksums
844968caaab3f6f35dc35c839f1b257440eaba7177effac5a436d8ca454f379d
BLAKE2b-256 checksum
How to use checksums
6667aed59f7845bdbb8c26c79cb92c7949b4702a444355c9b27b1379440a7988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / brrag-0.0.5-py3-none-any.whl

Download URL brrag-0.0.5-py3-none-any.whl
Size 39.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19a622d1a6d18f0a6bc548f7168471f7c5dc07d665554fb36abbc356137c0333
BLAKE2b-256 checksum
How to use checksums
99f16f75bdf67966872856ae766973edfa2edc9a4dc4b8a8bb16ef13e752a88f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for brrag 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for brrag-0.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page