Dönüştür-JSON-to-Excel

JSON’i Excel Çalışma Kitabına Dönüştür

JSON Excel dosyasına nasıl çevrilir diye düşünmenize gerek yok çünkü Aspose.Cells for Python via Java kütüphanesi en doğru kararı veriyor. Aspose.Cells for Python via Java API, JSON formatını elektronik tablolara dönüştürmek için destek sağlar. KullanabilirsinizJsonLoadOptions JSON’i Çalışma Kitabına içe aktarmak için ek ayarları belirtmek için sınıf.

Aşağıdaki kod örneği, JSON’in Excel Çalışma Kitabına alınmasını gösterir. Lütfen dönüştürülecek koda bakınKaynak dosyası referans için kod tarafından oluşturulan dosyaya.

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()

Ek ayarlar belirtmek için JsonLoadOptions sınıfını kullanan aşağıdaki kod örneği, JSON’in Excel Çalışma Kitabına alınmasını gösterir. Lütfen dönüştürülecek koda bakınKaynak dosyası referans için kod tarafından oluşturulan xlsx dosyasına.

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()