book.xml_helper module

XML 파싱 Helper.

class book.xml_helper.XmlDictConfig(parent_element)[source]

Bases: dict

Example usage.

>>> tree = ElementTree.parse('your_file.xml')
>>> root = tree.getroot()
>>> xmldict = XmlDictConfig(root)

Or, if you want to use an XML string:

>>> xml_string = "<test>Hello World</test>"
>>> root = ElementTree.XML(xml_string)
>>> xmldict = XmlDictConfig(root)

And then use xmldict for what it is… a dict.

class book.xml_helper.XmlListConfig(a_list)[source]

Bases: list

Xml 을 List 로 가져옴.

book.xml_helper.get_xml_request(url: str)[source]

XML 을 리턴하는 URL 을 받아서 파싱된 결과를 리턴.

Parameters

url – API URL

Returns