Untangle
เราสามารถใช้ untangle สร้าง Python Objects จาก XML File ได้
untangle เป็น Library เรียบง่ายที่รับ XML Document และคืนค่า Python Object ที่ Mirror Nodes และ Attributes ในโครงสร้างของมัน
ตัวอย่าง XML File แบบนี้ -
<?xml version="1.0"?>
<root>
<child name="child1">
</root>
สามารถ Load ได้แบบนี้ -
import untangle
obj = untangle.parse('path/to/file.xml')
และเข้าถึงชื่อ Child Elements ได้แบบนี้ -
obj.root.child['name']
untangle ยังรองรับการ Load XML จาก String หรือ URL ด้วย