you need to read the file and send it to the parser
with open("abc.xml", 'r') as f text_xml = f.read() o = xmltodict.parse(text_xml) json.dumps(o)