Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Created June 16, 2020 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Allwin12/f0a7294d0f68ece8c93bfdb17d8d2aa3 to your computer and use it in GitHub Desktop.
Save Allwin12/f0a7294d0f68ece8c93bfdb17d8d2aa3 to your computer and use it in GitHub Desktop.
from json2xml import json2xml
from json2xml.utils import readfromurl, readfromstring, readfromjson
data = '''{
"name": "John",
"job": "Engineer",
"dob": "23-04-1986",
"age": 34,
"country": "Brazil"
}'''
data = readfromjson("user.json")
print(json2xml.Json2xml(data, attr_type=False).to_xml())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment