3890
Comment:
|
4318
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
== Packages in the standard library == |
|
Line 7: | Line 9: |
* a pythonesque, simple-to-use and very fast XML tree library: * ElementTree - the xml.etree package (new in Python 2.5 but available for older versions) * an event-driven XML parser compatible with the W3C SAX standard: * [[Sax]] - the xml.sax package |
|
Line 10: | Line 16: |
* an event-driven XML parser compatible with the W3C SAX standard: * [[Sax]] - the xml.sax package * a pythonesque XML tree library: * ElementTree - the xml.etree package (new in Python 2.5) |
|
Line 24: | Line 26: |
* [[http://codespeak.net/lxml/|lxml]] - a pythonic, ElementTree-compatible binding for the libxml2 and libxslt libraries that comes with all sorts of powerful XML tools, well integrated into an easy-to-use Python API | * [[http://codespeak.net/lxml/|lxml]] - a pythonic, ElementTree-compatible binding for the libxml2 and libxslt libraries that comes with all sorts of powerful XML (and HTML) tools, well integrated into an easy-to-use Python API |
Line 35: | Line 37: |
=== XPath Support === * [[http://code.google.com/p/py-dom-xpath/|py-dom-xpath]] - pure Python XPath implementation for use with DOM libraries |
|
Line 36: | Line 42: |
If not mentioned otherwise, this means XSLT 1.0, not XSLT 2.0. |
|
Line 52: | Line 60: |
* PythonSoap | * see [[WebServices]] === Object Serialisation in XML === * [[http://coder.cl/software/pyxser/|pyxser]] |
Python and XML
A variety of XML processing solutions are available for Python. This page attempts, at the very least, to list the most actively developed or most easily available.
Packages in the standard library
The standard library has a number of tools available, which fall into mainly three categories:
- a pythonesque, simple-to-use and very fast XML tree library:
ElementTree - the xml.etree package (new in Python 2.5 but available for older versions)
- an event-driven XML parser compatible with the W3C SAX standard:
Sax - the xml.sax package
- XML tree libraries that adhere to the W3C DOM standard:
The DOM and SAX packages have the advantage of being compatible to W3C standard APIs, so users who are already familiar with these APIs can use them without learning too many new things. Everyone else should start with the more pythonic ElementTree library, which is very well integrated into the Python language, and therefore very easy to learn and use.
External packages
A long list of special purpose and general purpose Python XML packages is available from PyPI. The following is a choice of major tools that support a broader set of XML features.
Pythonic tools
Amara - Amara provides tools you can trust to conform with XML standards without losing the familiar Python feel
lxml - a pythonic, ElementTree-compatible binding for the libxml2 and libxslt libraries that comes with all sorts of powerful XML (and HTML) tools, well integrated into an easy-to-use Python API
lxml.objectify - a Python object API for XML based on lxml
W3C DOM-like libraries
4Suite - a framework for XML (and RDF) processing
itools.xml - itools provides XML processing support in a fashion similar to that of PullDom
libxml2dom - PyXML-style API for the libxml2 Python bindings
PyXML - external add-on to Python's original XML support - WARNING: this is no longer maintained! Do not use in new code!
qtxmldom - PyXML-style API for the qtxml Python bindings
XPath Support
py-dom-xpath - pure Python XPath implementation for use with DOM libraries
XSLT Support
If not mentioned otherwise, this means XSLT 1.0, not XSLT 2.0.
XSLT tools for Python - an (older) collection of examples and links by Uche Ogbuji
lxml has excellent support for XSLT that is based on libxslt
XSLTools - XSL transformations on top of libxslt and libxml2dom, with added Web development support
Some tools linked from the XQuery homepage provide Python bindings for their XSLT2 and XPath2 implementations
XML-based Communications
PyXMPP - a Python XMPP (RFC 3920,3921) and Jabber implementation
jabber.py - a Python module for the jabber instant messaging protocol
xmpppy - a Python library that is targeted to provide easy scripting with Jabber
Web Services
Object Serialisation in XML
Books and Articles
SIG
Editorial Notes
The above lists should be arranged in ascending alphabetical order - please respect this when adding new entries. When specifying release dates please use the format YYYY-MM-DD.