This is for issue#31
I have added two functions in cleverdict.py file to handle creation of CleverDict from csv files and exporting of CleverDict objects into csv files. The CleverDicts created with from_csv function will be a nested CleverDict where top level dict will be indexed from 0 and each row will be converted to a CleverDict object, allowing people to use it like a list of dicts. For example:
The to_csv function requires a similarly formatted CleverDict of CleverDicts and each underlying cleverdict is exported as a row, allowing the use of ignore, only parameters.
Ample tests have also been added in the existing tests file.
The code has been tested under Python 3.7 on Linux and 3.9 on Windows and all tests pass successfully.
I have made use of the csv library to read and write csv files.
This is for issue#31 I have added two functions in cleverdict.py file to handle creation of CleverDict from csv files and exporting of CleverDict objects into csv files. The CleverDicts created with from_csv function will be a nested CleverDict where top level dict will be indexed from 0 and each row will be converted to a CleverDict object, allowing people to use it like a list of dicts. For example:
The to_csv function requires a similarly formatted CleverDict of CleverDicts and each underlying cleverdict is exported as a row, allowing the use of ignore, only parameters.
Ample tests have also been added in the existing tests file. The code has been tested under Python 3.7 on Linux and 3.9 on Windows and all tests pass successfully. I have made use of the csv library to read and write csv files.