MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / read_csv_as_dicts

Function read_csv_as_dicts

Solutions/7_6/reader.py:30–35  ·  view source on GitHub ↗

Read CSV data into a list of dictionaries with optional type conversion

(filename, types, *, headers=None)

Source from the content-addressed store, hash-verified

28 lambda headers, row: cls.from_row(row))
29
30def read_csv_as_dicts(filename, types, *, headers=None):
31 '''
32 Read CSV data into a list of dictionaries with optional type conversion
33 '''
34 with open(filename) as file:
35 return csv_as_dicts(file, types, headers=headers)
36
37def read_csv_as_instances(filename, cls, *, headers=None):
38 '''

Callers

nothing calls this directly

Calls 1

csv_as_dictsFunction · 0.70

Tested by

no test coverage detected