1

In Python, how do I extract particular columns from the following JSON style from a URL then convert them to a CSV file

[  
  {  
  "col_1":123,
  "col_2":"value",
  "col_3":"value",
  },
  {  
  "col_1":123,
  "col_2":"value",
  "col_3":"value",
  },
  {  
  "col_1":123,
  "col_2":"value",
  "col_3":"value",
  },
  ...
]
geek-tech
  • 323
  • 2
  • 4
  • 13
  • If you want to convert json to CSV maybe this answer will be helpfull: https://stackoverflow.com/questions/1871524/how-can-i-convert-json-to-csv – DavidS Jun 14 '17 at 11:05
  • Here an answer to the same question : https://stackoverflow.com/questions/1871524/how-can-i-convert-json-to-csv – talalUcef Jun 14 '17 at 11:06
  • Thanks! But this is not from a URL? – geek-tech Jun 14 '17 at 11:06
  • Get your data into a Python `list` of `dict`s, then look at [csv.DictWriter](https://docs.python.org/3/library/csv.html#csv.DictWriter) – Jon Clements Jun 14 '17 at 11:08

0 Answers0