[New-bugs-announce] [issue37940] Add xml.tool to pretty print XML like json.tool
Karthikeyan Singaravelan
report at bugs.python.org
Sat Aug 24 10:55:33 EDT 2019
New submission from Karthikeyan Singaravelan <tir.karthi at gmail.com>:
Now that XML has pretty print option with issue14465 would it be handy to add a command line tool pretty printer similar to json.tool? This can be written as one-liner similar to json pretty printing but I think it's a good option and having a command line tool also helps in piping the output to other commands like filtering particular tags. I tried searching mailing list and couldn't find any discussions along these lines. There were some concerns around using external tools and in https://bugs.python.org/issue14465#msg324098 . I thought to open this to gather feedback.
Branch : https://github.com/tirkarthi/cpython/tree/bpo14465-xml-tool
python -m xml.tool /tmp/person.xml
<root>
<person name="Kate">
<breakfast>Idly</breakfast>
</person>
<person name="John">
<breakfast>Dosa</breakfast>
</person>
</root>
# Get all breakfast tags
python -m xml.tool /tmp/person.xml | grep breakfast
<breakfast>Idly</breakfast>
<breakfast>Dosa</breakfast>
----------
components: Library (Lib)
messages: 350372
nosy: eli.bendersky, rhettinger, scoder, serhiy.storchaka, xtreak
priority: normal
severity: normal
status: open
title: Add xml.tool to pretty print XML like json.tool
type: enhancement
versions: Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37940>
_______________________________________
More information about the New-bugs-announce
mailing list