What's the best way to convert XML to a dictionary in Python? or How can I efficiently parse XML into

20 Replies, 1884 Views

For lightweight python XML to dict, I’d say stick with xmltodict. It’s not perfect, but it’s the closest thing to "just works."

If you need more control, `defusedxml` + `ElementTree` is safer for sketchy XML sources.

Also, watch out for CDATA sections—some libs choke on those.

Messages In This Thread



Users browsing this thread: 1 Guest(s)