I have many dictionaries which are not consistent in term of keys, I have to write them to CSV.
While using DictWriter, it requires to define the headers at declaration which I don't know. I also can't store them in list till I have had all the dict as the count of dict run into millions.
I'm in search of library that I can keep on writing CSV with inconsistent rows, and it manages them below the hood.
Data :
{'a':'1','i':'1','l':None}
{'b':'1','k':'1','y':None}
{'g':'1','k':'1','j':None}
{'b':'1','h':'1','c':None}
{'b':'1','h':'1','n':None}
{'a':'1','b':'1','v':None}
{'a':'1','b':'1','c':None}
Expected Output: (CSV like this)
a c b g i h k j l n v y
1 1
1 1
1 1
1 1
1 1
1 1
1 1
This data on top, is coming from iterator, can't store it in memory as it's very large.