A library and command-line tool to "prettify" XML.
Project description
Pretty-Print XML
================
A library and command-line tool to "prettify" XML.
Installation
------------
``` bash
$ pip install pxml
::
## On the Command-Line
$ echo '<root><node attr="value">foo</node></root>' | pxml
<?xml version="1.0" encoding="utf-8"?>
<root>
<node attr="value">foo</node>
</root>
::
And add some color:
![pxml with color](https://raw.github.com/metagriffin/pxml/master/pxml-color.png "pxml with color")
## As a Python Module
``` python
import pxml, StringIO
src = StringIO('<root><node attr="value">foo</node></root>')
out = StringIO()
pxml.prettify(src, out)
assert(out.getvalue() == '''\
<?xml version="1.0" encoding="utf-8"?>
<root>
<node attr="value">foo</node>
</root>
''')
================
A library and command-line tool to "prettify" XML.
Installation
------------
``` bash
$ pip install pxml
::
## On the Command-Line
$ echo '<root><node attr="value">foo</node></root>' | pxml
<?xml version="1.0" encoding="utf-8"?>
<root>
<node attr="value">foo</node>
</root>
::
And add some color:
![pxml with color](https://raw.github.com/metagriffin/pxml/master/pxml-color.png "pxml with color")
## As a Python Module
``` python
import pxml, StringIO
src = StringIO('<root><node attr="value">foo</node></root>')
out = StringIO()
pxml.prettify(src, out)
assert(out.getvalue() == '''\
<?xml version="1.0" encoding="utf-8"?>
<root>
<node attr="value">foo</node>
</root>
''')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pxml-0.2.2.tar.gz
(5.9 kB
view hashes)