CLEVERCSV-DETECT(1)
β¨ 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 usingchardet. Now,chardetis 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-runtimeis 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 π
π¦ where this page comes from
- arch rolling: python-clevercsv 0.8.5-1 Β· MIT
- nixos 26.05: python3.13-clevercsv 0.8.5
- nixos 26.05: python3.14-clevercsv 0.8.5
- nixpkgs unstable: python3.13-clevercsv 0.8.5
- nixpkgs unstable: python3.14-clevercsv 0.8.5
- ubuntu stonking: python3-clevercsv 0.8.5+ds-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms