3 ms·
I tend to use python (usually in a jupyter notebook) and pandas. Lots of experimentation with pandas' json_normalize() function. https://towardsdatascience.com/
by screature2 5y ago
I tend to use python (usually in a jupyter notebook) and pandas. Lots of experimentation with pandas' json_normalize() function.
https://towardsdatascience.com/all-pandas-json-normalize-you-should-know-for-flattening-json-13eae1dfb7dd https://towardsdatascience.com/all-pandas-json-normalize-you...
then just call to_csv() on the dataframe. (edited to add to comment on exporting to CSV as per the original question).
- dec0dedab0de 5y agoI also use jupyter for this, but my goto is tablib. for anyone who hasn't used it, it's super easy to switch between tabular data formats. you create an instance of their Dataset class, then assign your data to the appropriate property, and all of the other properties are your data in the respective format for instance: from tablib import Dataset json_array_of_objects = '[{"header": "data1"}, {"header": "data2"}]' ds = Dataset() ds.json = json_array_of_objects ds.csv # data formatted as a csv ds.xlsx # excel, only useful on a binary read or write ds.dict # list of dictionaries ds.json # list of dictionaries converted to json ds.jira # table formatted for jiras markup ds.html # html table # and more they used to vendorize dependencies, so everything worked out of the box, but now some features need to be installed specifically, or do pip install tablib[all], which is kind of annoying. I suspect they started doing it when they included support for pandas dataframes, because they didn't want to vendorize all of pandas. or force it to install as a requirement.