Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Pythonic XML Data Binding Package

Project Description

NodeTree provides a clean, modern API for working with XML in Python.

Version 0.3 adds support for XML document parsing:

>>> import nodetree
>>> d = nodetree.Document('<article><p>Pre <b>Bold</b> Post</p></article>')
>>> d
<?xml version="1.0"?>
<article>
  <p>Pre <b>Bold</b> Post</p>
</article>
>>> str(d.root)
'<?xml version="1.0"?>\n<article><p>Pre <b>Bold</b> Post</p></article>\n'
>>> d.root[0]
<p>Pre <b>Bold</b> Post</p>
>>> d.root[0].pop()
' Post'
>>> d.root[0][0] = 'Plain Text vs '
>>> d.root
<article>
  <p>Plain Text vs <b>Bold</b></p>
</article>

XML streams (eg, XMPP) are also now supported with progressive parsing:

>>> import nodetree
>>> s = nodetree.Stream('<stream:stream xmlns="jabber:client" ' +
                        'xmlns:stream="http://etherx.jabber.org/streams">')
>>> s.send('<message><body>Hello, World!</body></message>')
>>> s.root.pop(0)
<message>
  <body>Hello, World!</body>
</message>
>>> s.send('<message><body>This works')
>>> s.root.pop(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: incomplete branch
>>> s.send(' well</body></message>')
>>> s.root.pop(0)
<message>
  <body>This works well</body>
</message>

This release also adds support for ProcessingInstruction nodes and fixes several bugs regarding XML branch splicing and merging.

Warning

NodeTree is still in early development; this release lacks several basic features and contains known bugs which may render it unsuitable for many applications. Notably, there is currently no access to XML namespaces from Python and no support for CDATA nodes, XPath, or XSLT.

Release History

Release History

This version
History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
NodeTree-0.3.tar.bz2 (32.4 kB) Copy SHA256 Checksum SHA256 Source Jan 18, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting