Skip to main content

WODCraft DSL: unified language-first CLI and tools

Project description

WODCraft

English | Français

WODCraft is a Domain‑Specific Language (DSL) to describe, validate, and export Workouts of the Day (WODs). It ships a single, unified CLI to parse, lint, compile sessions, and export (JSON/ICS), with support for tracks and gender through a movements catalog.

Why

  • Standardize how WODs are written, readable by coaches and tools.
  • Automate useful formats: timer timeline, calendar, web, API.
  • Normalize variants (tracks, dual reps/cals/loads) via a JSON catalog.
  • Provide a solid base for AI agents to analyze/generate WODs.

DSL at a Glance

WOD "Team Mixer"
TEAM 2
TRACKS [RX, INTERMEDIATE, SCALED]
CAP 20:00

BUYIN {
  400m run;
}

BLOCK AMRAP 12:00 WORK split:any {
  12 wall_balls @9kg SYNC;
  10 box_jumps @24in;
  200m run;
}

CASHOUT {
  50 double_unders @each;
}

The full grammar and rules are in WODCraft_spec.md (source of truth).

Features

  • Parser → structured JSON AST.
  • Linter → errors/warnings (e.g., E010 REST>0, E020 EMOM without slots, W001 unknown movement, W002 suspicious load, W050 alias).
  • Resolution → applies --track/--gender and an optional JSON --catalog.
  • Timeline → run produces an event sequence (text or JSON).
  • Export → export to json, html, ics.
  • Formatting → fmt (minimal safe normalization of .wod files).

Quick Setup

  • Python 3 recommended. Isolated env:
    • make install (creates .venv and installs requirements.txt)
    • or pip install -r requirements.txt

CLI Usage (unified)

  • Validate: wodc validate examples/language/team_realized_session.wod
  • Parse: wodc parse examples/language/team_realized_session.wod
  • Session → JSON/ICS: wodc session examples/language/team_realized_session.wod --modules-path modules --format json
  • Results aggregate: wodc results examples/language/team_realized_session.wod --modules-path modules
  • Catalog build: wodc catalog build

Makefile shortcuts: make help (venv, install, test, catalog-build, vnext-validate, vnext-session, vnext-results, build-dist).

Tests

  • Run: make test or pytest -q
  • Coverage includes: parser, lint (E/W), resolution (catalog/gender), timeline, formatter.

Spec and Architecture

  • DSL spec: see WODCraft_spec.md.
  • Unified CLI: src/wodcraft/cli.py (entrypoint wodc).
  • Language core: src/wodcraft/lang/core.py (façade over vNext core).
  • vNext core: wodc_vnext/core.py (modules/sessions/types), slated to be merged under src/.
  • Examples under examples/ and modules under modules/. Movements catalog at data/movements_catalog.json.

Editor Support

  • VS Code/Windsurf extension (local): see editor/wodcraft-vscode/ for syntax highlighting and snippets.
  • Quick dev run: code --extensionDevelopmentPath=./editor/wodcraft-vscode .

Examples (Language / Programming)

  • examples/language/programming_plan.wod: minimal “Coach Programming” block
  • examples/language/team_realized_session.wod: session with team + realized events for aggregation

Roadmap

  • Advanced formatter (indentation/blocks), macros and shorthands (21-15-9).
  • Versioned grammar and canonical wodc fmt.
  • Executable timer for gym use.

Contributing

  • Read AGENTS.md (conventions, structure, commands).
  • Open focused PRs with CLI examples and export artifacts.

📜 License

  • Code (DSL, tools, generators) : Apache 2.0
  • Content (docs, movement list, examples, images/videos) : CC-BY-SA 4.0

In summary:
You can freely use WODCraft in your projects, including commercial ones, as long as you cite the source.
Content (movements, docs, etc.) must remain open and under the same CC-BY-SA license.


© 2025 Nicolas Caussin - caussin@aumana-consulting.com

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

wodcraft-0.1.0.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

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

wodcraft-0.1.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file wodcraft-0.1.0.tar.gz.

File metadata

  • Download URL: wodcraft-0.1.0.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for wodcraft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0e36fecf0e91499c42146118ed6f1b21dd58ff15de4e9184f030eab9b696ff15
MD5 1b37a2fbbccec2c26e492cb9e2fcc9a6
BLAKE2b-256 5f3240998160c62c701057012f005d0e6eec586f1203fcfc350e72863a295d3b

See more details on using hashes here.

File details

Details for the file wodcraft-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wodcraft-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for wodcraft-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30ca1f1020d97b8347ecb78e6ba93d43778228787e602cd4416b7a5af7e28b38
MD5 0090e3267705d5e36be40afd251d5619
BLAKE2b-256 d1026efe97c4045ed31a399f211b0435de08381241074218c3673b003ea31d8d

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