1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

update csv_s parser with csv changes

This commit is contained in:
Kelly Brazil
2022-01-02 11:44:18 -08:00
parent 2a40f84274
commit 9c887a36a8

View File

@ -56,7 +56,7 @@ from jc.exceptions import ParseError
class info(): class info():
"""Provides parser metadata (version, author, etc.)""" """Provides parser metadata (version, author, etc.)"""
version = '1.1' version = '1.2'
description = 'CSV file streaming parser' description = 'CSV file streaming parser'
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
@ -122,9 +122,11 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
sniffdata = '\n'.join(temp_list) sniffdata = '\n'.join(temp_list)
dialect = None dialect = 'excel' # default in csv module
try: try:
dialect = csv.Sniffer().sniff(sniffdata) dialect = csv.Sniffer().sniff(sniffdata)
if '""' in sniffdata:
dialect.doublequote = True
except Exception: except Exception:
pass pass