Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

import csv 

from os import path 

 

ASSETS_PATH = path.join(path.realpath(__file__), "../assets/") # noqa: E402 

 

 

def csv_2_dict_list(fp: str): 

""" 

Reads a CSV file (with header row!) and returns it as a list of OrderedDict 

:param fp: csv file path 

:type fp: str 

:return: 

""" 

with open(fp, "r") as f: 

reader = csv.DictReader(f, delimiter=",") 

return [r for r in reader]