#!/usr/bin/env python3 """Show every non-empty field on each workout component, to find what the renderer is dropping.""" from __future__ import annotations import sys sys.path.insert(0, "src") from wodify import client, render # noqa: E402 date = sys.argv[1] if len(sys.argv) > 1 else "2026-07-20" data = client.call("workout", {"SelectedDate": date}) for wod in render.find_all(data, "ResponseWorkout"): if not isinstance(wod, dict) or str(wod.get("Id", "0")) == "0": continue print(f"WOD {wod.get('Name')} keys={sorted(wod)}") for container in render.find_all(wod, "WorkoutComponents"): if not isinstance(container, dict): continue for comp in container.get("List") or []: if not isinstance(comp, dict): continue print("=" * 70) for key, value in comp.items(): if isinstance(value, (dict, list)): if isinstance(value, dict) and value: print(f" {key}: ") elif isinstance(value, list) and value: print(f" {key}: ") continue if value in ("", 0, False, None, "0", "1900-01-01", "00:00:00"): continue text = str(value) if key in ("Name", "Comment", "PrefixText"): text = render.flatten_html(text).replace("\n", " | ") print(f" {key}: {text[:220]}")