How to convert JSON to XLS in Python

fakelbst picture fakelbst · Mar 13, 2013 · Viewed 52.1k times · Source

Does anyone know how can I convert JSON to XLS in Python?

I know that it is possible to create xls files using the package xlwt in Python.

What if I want convert a JSON data convert to XLS file directly?

Is there a way to archive this?

Answer

Bruno Lopes picture Bruno Lopes · Apr 13, 2016

Using pandas (0.15.1) and openpyxl (1.8.6):

import pandas
pandas.read_json("input.json").to_excel("output.xlsx")