jsonextended.parsers.csvs module

class jsonextended.parsers.csvs.CSV_Parser[source]

Bases: object

Examples

>>> from pprint import pprint
>>> from jsonextended.utils import MockPath
>>> fileobj = MockPath(is_file=True,
... content='''# comment line
... head1,head2
... val1,val2
... val3,val4'''
... )
>>> with fileobj.open() as f:
...     data = CSV_Parser().read_file(f)
>>> pprint(data)
{'head1': ['val1', 'val3'], 'head2': ['val2', 'val4']}
file_regex = '*.csv'
plugin_descript = 'read *.csv delimited file with headers to {header:[column_values]}'
plugin_name = 'csv.basic'
read_file(file_obj, **kwargs)[source]