Read XML file into dictionary

    0

    7

    Python public recipes

    Shortcut: xml.file.read-as-dict

    import xmltodict
    
    with open(xmlfile, 'r', encoding='utf-8') as file:
      my_xml = file.read()
      my_dict = xmltodict.parse(my_xml)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.