CLEVERCSV-DETECT(1)

πŸ“¦
version 0.8.5 Β· 4 versions
, in arch rolling, nixos 26.05, nixpkgs unstable, ubuntu stonking

✨ NAME ✨

clevercsv-detect β€” ooh bestie this is the one that detects the dialect of a CSV file πŸ’… like it sniffs out the vibe of your file and tells you what's going on


🌸 SYNOPSIS 🌸

clevercsv detect [-c | --consistency] [-e ENCODING | --encoding=ENCODING]
                 [-n NUM_CHARS | --num-chars=NUM_CHARS] [ -p | --plain |
                 -j | --json ] [--no-skip] [--add-runtime] <path>

πŸ’– DESCRIPTION πŸ’–

Detect the dialect of a CSV file. That's it. That's the whole thing. She looks at your file, she figures out how it's formatted, she reports back. Iconic behaviour, no notes πŸŽ€


✨ OPTIONS ✨

  • -h, --help β€” show this help message and exit. your little escape hatch, love that for you 🫢
  • -c, --consistency β€” okay so normally the dialect detection runs as a two-step process. First up, a strict set of checks gets used to see if the file adheres to a very basic format (like, for example, when all cells in the file are integers). If none of those checks succeed, then the data consistency measure of Van den Burg, et al. (2019) is what detects the dialect. With this option you can force the detection to always use the data consistency measure. Super useful for testing or research purposes, for instance πŸ’œ
  • -e, --encoding β€” the file encoding of the given CSV file gets automatically detected using chardet. Now, chardet is incredibly accurate, but she's not perfect, bestie 😭 in the rare cases where it makes a mistake detecting the file encoding, you can override the encoding by providing it through this flag. Also, when you have a number of CSV files with a known file encoding, you can use this option to speed up the code generation process. multitasking queen ✨
  • -n, --num-chars β€” on large CSV files, dialect detection can sometimes be a bit slow, because there are so many possible dialects to consider. To alleviate this, you can limit the number of characters used for detection.

One thing to keep in mind though: CleverCSV may need to read a specific number of characters to be able to correctly infer the dialect. For example, in the imdb.csv file in the GitHub repository, the correct dialect can only be found after at least 66 lines of the file are read. So if there's availability to run CleverCSV on the entire file, that is generally recommended. fr fr listen to her on this one 🌈

  • -p, --plain β€” print the components of the dialect on separate lines. simple. clean. minimal. we love a low-key output 🌸
  • -j, --json β€” print the dialect to standard output in the form of a JSON object. This object will always have the 'delimiter', 'quotechar', 'escapechar', and 'strict' keys. If --add-runtime is specified, it will also have a 'runtime' key. structured data girlies rise πŸ‘‘
  • --no-skip β€” so the data consistency score used for dialect detection consists of two components: a pattern score and a type score. The type score lies between 0 and 1. When computing the data consistency measures for different dialects, we skip the computation of the type score if we see that the pattern score is lower than the best data consistency score we've seen so far. This option can be used to disable this behaviour and compute the type score for all dialects. Mainly useful for debugging and testing purposes 🧚
  • --add-runtime β€” add the runtime of the detection to the detection output. she's timing herself, and honestly? she should πŸ’…
  • <path> β€” path to the CSV file. point her at it, she does the rest πŸ’–

πŸ¦‹ CLEVERCSV πŸ¦‹

Part of the CleverCSV suite ✨ the whole family is gorgeous


mwaaah that's the whole page bestie, go forth and detect some dialects πŸŽ€

Clevercsv 0.8.5 Β· 2026-05-11 β€” yeah that's the version and the date, she's giving vintage-and-current simultaneously, iykyk πŸ’œ