Interactive arrow-key wrapper around the headless scripts/run_simulation_cli.py.
Walks the user through race / driver / laps / provider selection, auto-resolves
the driver's team from data/processed/laps_featured_2025.parquet, and shells
out to the headless runner with the right argv. Pure UX layer — no simulation
logic lives here.
python scripts/f1_cli.py
- Single Driver — full per-lap simulation for one driver in one race.
- Head-to-Head — full simulation for Driver 1; Driver 2 is tracked as a
rival in the same run via the
--rivalflag passed torun_simulation_cli.py(no second subprocess).
theme.py— F1 brand palette (F1_RED,F1_AMBER,F1_GREEN,F1_WHITE,F1_GRAY), shared Richconsolesingleton, and the ASCII welcome banner.pickers.py—_arrow_pickprimitive (Windowsmsvcrt+ POSIXtermiosbranches), all interactive prompts (pick_mode,pick_race,pick_driver,pick_rival_code,pick_laps,pick_provider,ask_again), plusdiscover_races(repo_root, year)and the_load_driver_team_map(repo_root)parquet lookup.runner.py—build_sim_cmd(...)builds the argv forrun_simulation_cli.py,run_subprocess(cmd)executes it withPYTHONIOENCODING=utf-8+PYTHONUTF8=1, andrun_single/run_h2hare the two wizard flows.../f1_cli.py— top-level entry point. Loopspick_mode→run_single/run_h2huntil the user picks Quit.
- Write the prompt helper in
pickers.py(use_arrow_pickfor menus, orPrompt.askfor free-text). - Wire the call into
runner.py:run_singleand/orrun_h2h, and forward the value intobuild_sim_cmdas a new kwarg + correspondingcmd.extend.
The package enables VT-100 processing on Windows via ctypes
SetConsoleMode(GetStdHandle(-11), 7) so ANSI escape codes (cursor moves,
colors, the red ❯ cursor) render correctly in cmd.exe and Windows
Terminal. The call is a no-op on non-Windows platforms.