mirror of
https://github.com/Astatin3/pymcstatus.git
synced 2026-06-08 16:18:05 -06:00
18 lines
482 B
Python
18 lines
482 B
Python
|
|
import sys
|
||
|
|
import json
|
||
|
|
from openpyxl import Workbook
|
||
|
|
|
||
|
|
inputfile = sys.argv[1]
|
||
|
|
outputfile = sys.argv[2]
|
||
|
|
|
||
|
|
book = Workbook()
|
||
|
|
sheet = book.active
|
||
|
|
|
||
|
|
sheet.append(("ip", "latency", "pver", "ver", "cplayers", "mplayers", "motd", "isicon"))
|
||
|
|
|
||
|
|
with open(inputfile) as f:
|
||
|
|
data = json.load(f)
|
||
|
|
for entry in data:
|
||
|
|
sheet.append((entry["ip"], entry["latency"], entry["pver"], entry["ver"], entry["cplayers"], entry["mplayers"], entry["motd"], entry["isicon"]))
|
||
|
|
|
||
|
|
book.save(outputfile)
|