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:
@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user