Skip to content

Instantly share code, notes, and snippets.

View iljavs's full-sized avatar

Ilja van Sprundel iljavs

View GitHub Profile
@iljavs
iljavs / xml2json.py
Created February 25, 2024 22:17
convert xml to json
import xmltodict
import json
import sys
xmlfile = sys.argv[1]
jsonfile = xmlfile.replace('.xml', '.json')
with open(xmlfile, 'r') as file:
xml_string = file.read()
dict_data = xmltodict.parse(xml_string)