Convert-JSON-to-Excel
Contents
[
Hide
]
Aspose.Cells for Python via Java supports converting a Json(JavaScript Object Notation) file to Excel Workbook.
Convert JSON to Excel Workbook
No need to wonder how to convert JSON to Excel file, because Aspose.Cells for Python via Java library has best decision. The Aspose.Cells for Python via Java API provides support for converting JSON format to spreadsheets. You can use JsonLoadOptions class to specify additional settings for importing JSON to Workbook.
The following code example demonstrates importing JSON to Excel Workbook. Please see the code to convert source file to the file generated by the code for reference.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook | |
# Load Source JSON file | |
workbook = Workbook("sample.json") | |
# Save file to xlsx format | |
workbook.save("sample_out.xlsx") | |
jpype.shutdownJVM() |
The following code example which uses JsonLoadOptions class to specify additional settings demonstrates importing JSON to Excel Workbook. Please see the code to convert source file to the xlsx file generated by the code for reference.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, JsonLoadOptions | |
# Create an options of loading the file. | |
options = JsonLoadOptions() | |
# Indicates whether importing each attribute of JsonObject object as one worksheet when all child nodes are array nodes. | |
options.setMultipleWorksheets(True) | |
book = Workbook("sample.json", options) | |
# save file to xlsx format | |
book.save("sample_out2.xlsx") | |
jpype.shutdownJVM() |