class csv.Sniffer
The Sniffer class is used to deduce the format of a CSV file.
The Sniffer class provides two methods:
-
sniff(sample, delimiters=None) -
Analyze the given sample and return a
Dialectsubclass reflecting the parameters found. If the optional delimiters parameter is given, it is interpreted as a string containing possible valid delimiter characters.
-
has_header(sample) -
Analyze the sample text (presumed to be in CSV format) and return
Trueif the first row appears to be a series of column headers.
Please login to continue.