I have a csv file that has the headers and the value lines are:
site,access_key,secret_access_key
sa1,something,something
na1,something,something
and so on. I would like the dictionary to look like
site_dict = {"sa1" :{"access_key" : "something", "secret_access_key" : "something"}, "na1" :{"access_key" : "something", "secret_access_key" : "something"}}
I tried what was suggested here : How to create a nested dictionary from a csv file with N rows in Python but it deals with numeric values and I could not get my head around changing it to string values. Any help would be appreciated. If you make a suggestion or provide an answer please make it an answer so I can mark it appropriately. EDIT: I changed the sa1 and na1 to keys by adding the quotes.