Skip to content

Instantly share code, notes, and snippets.

@pchatterjee
Created April 24, 2023 15:46
Show Gist options
  • Save pchatterjee/cf996f2b7b3ca852eceb640b12aeeb43 to your computer and use it in GitHub Desktop.
Save pchatterjee/cf996f2b7b3ca852eceb640b12aeeb43 to your computer and use it in GitHub Desktop.
import xmltodict
import json
with open("quotes.xml") as xml_file:
data_dict = xmltodict.parse(xml_file.read())
json_data = json.dumps(data_dict, indent=2)
print(json_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment