Command Line Interface (CLI)
pyopenf1 includes a powerful CLI tool that allows you to fetch OpenF1 data directly from your terminal, without writing any Python code.
Usage
Output Formats
The CLI can output data in three formats using the --format flag.
Rich, human-readable terminal tables.
$ pyopenf1 drivers --session 9158 --format table
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ Driver Number ┃ Name ┃ Team ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│ 1 │ Max Verstappen │ Red Bull Racing │
│ 4 │ Lando Norris │ McLaren │
└───────────────┴────────────────┴──────────────────┘
Perfect for piping into jq or saving to files.
Filtering
You can pass standard OpenF1 filtering parameters as flags: