CSV Dialect
A CSV dialect is the set of format parameters of a CSV file: delimiter, quote character, escape character, line terminator, header presence, and so on, which vary across tools.
Purpose
To describe the format conventions of a particular CSV file so parsers handle non-standard CSV correctly (e.g., TSV, semicolon-separated, custom quotes).
Mechanism
Dialect parameters: delimiter (default ,), quotechar (default "), escapechar, lineterminator (default \r\n), skipinitialspace, and the quoting strategy. Python's csv.Dialect encapsulates these.
Use cases
- Multi-dialect CSV parsing
- Excel CSV compatibility
- TSV/PSV handling