Welcome folks today in this blog post we will be converting json file
to excel file
using python and json2xls
library. All the full source code of the application is given below.
Get Started
In order to get started you need to install the following library using the pip
command as shown below
pip install json2xls
After installing this library you need to make an app.py
file and copy paste the following code
app.py
1 2 3 4 5 6 7 8 |
from json2xls import Json2Xls # 从json字符串生成excel json_data = u'''[ {"姓名": "John", "年龄": 30, "性别": "男"}, {"姓名": "Alice", "年龄": 18, "性别": "女"} ]''' obj = Json2Xls('tests/json_strlist_test.xls', json_data) |
Now if you execute this python script by typing the below commnad
python app.py