how to convert json to csv or to store in sql

+1 vote
Jul 2, 2018 in Python by anonymous
112 views

1 answer to this question.

+1 vote
Best answer

You can convert JSON data to csv in python using the pandas library - 

data = pandas.read_json()
data.to_csv()

If you wish to store data in SQL, perhaps it might be best to read the JSON data and first store it in a python data structure, like dictionary or a list, depending on which is more suitable. You may then write that data to SQL.

answered Jul 2, 2018 by Nietzsche's daemon
• 4,260 points

selected Jul 3, 2018 by Sudhir

Related Questions In Python

0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
615 views
0 votes
1 answer

How can I convert JSON to CSV?

I am not sure this question is ...READ MORE

answered Oct 1, 2018 in Python by ariaholic
• 7,340 points
1,257 views
+1 vote
1 answer

How to convert records from csv to a list in Python?

If you are using Python 3.x then ...READ MORE

answered Jun 25 in Python by Arvind
• 2,680 points

edited Jun 26 by Kalgi 35 views
0 votes
1 answer

Convert string list of dict from csv into JSON object in python

You can use the ast module Ex: import ast s = """[{'10': ...READ MORE

answered Sep 12, 2018 in Python by Priyaj
• 56,520 points
386 views
0 votes
1 answer

Convert string list of dict from csv into JSON object in python

You can use the ast module Ex: import ast s = """[{'10': ...READ MORE

answered Sep 24, 2018 in Python by Priyaj
• 56,520 points
61 views
0 votes
1 answer

How to Convert usual text to executable machine code in python

what you are looking for is a ...READ MORE

answered Oct 1, 2018 in Python by Priyaj
• 56,520 points
33 views
0 votes
1 answer

How to convert date string to date object in python?

Use this :-  >>> datetime.datetime.strptime('24052010 ...READ MORE

answered Oct 22, 2018 in Python by Priyaj
• 56,520 points
108 views
0 votes
1 answer

How to convert datetime.date to UTC timestamp in Python

In Python 3 (< 3.3) From the docs ...READ MORE

answered Oct 31, 2018 in Python by Priyaj
• 56,520 points
1,623 views
0 votes
2 answers

Extracting data from a JSON file in Python

Here is what i found and was ...READ MORE

answered Nov 27, 2018 in Python by Rupali
6,678 views
0 votes
1 answer

Adding elements to a list in python

Use extend() instead: l = [5, 7, 12, ...READ MORE

answered Apr 23, 2018 in Python by Nietzsche's daemon
• 4,260 points
34 views