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

Function read_csv_as_dicts

Solutions/5_3/reader.py:19–24  ·  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

17 lambda headers, row: cls.from_row(row))
18
19def read_csv_as_dicts(filename, types, *, headers=None):
20 '''
21 Read CSV data into a list of dictionaries with optional type conversion
22 '''
23 with open(filename) as file:
24 return csv_as_dicts(file, types, headers=headers)
25
26def read_csv_as_instances(filename, cls, *, headers=None):
27 '''

Callers

nothing calls this directly

Calls 1

csv_as_dictsFunction · 0.70

Tested by

no test coverage detected