Title: How can I visualize an XML file as a tree in python interactively?
Tags: python;xml;tree;visualization
Question: I need to take an xml file and visualize it as a tree using python. The tree needs to be interactive in the sense that I can open and close the nodes. What python package would be suitable for this purpose?
Comment: Please provide more details. Have you tried anything? For _parsing_ the XML, you can use ElementTree, which comes with Python. It won't help you with the visualization, though.


Here is another answer: ElementTree XML library could solve your problem: https://docs.python.org/2/library/xml.etree.elementtree.html
Comment for this answer: ElementTree does not provide a way to interactively "open and close the nodes".

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:02/18/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python><xml><tree><visualization>', 'Title': 'How can I visualize an XML file as a tree in python interactively?', 'ViewCount': 1513, 'id': 60275838, 'user_AboutMe': None, 'user_AccountId': 17685556.0, 'user_DisplayName': 'Mathew Pazhur', 'user_Reputation': 21.0, 'user_Views': 7.0, 'user_id': 12838555.0}}