Extensible HTML/XML generator, cross-platform templating language, Oracle utilities and various other tools
XIST provides an extensible HTML and XML generator. XIST is also a XML parser with a very simple and pythonesque tree API. Every XML element type corresponds to a Python class and these Python classes provide a conversion method to transform the XML tree (e.g. into HTML). XIST can be considered ‘object oriented XSLT’.
XIST also includes the following modules and packages:
- ll.make is an object oriented make replacement. Like make it allows you to specify dependencies between files and actions to be executed when files don’t exist or are out of date with respect to one of their sources. But unlike make you can do this in a object oriented way and targets are not only limited to files.
- ll.url provides classes for parsing and constructing RFC 2396 compliant URLs.
- ll.orasql provides utilities for working with cx_Oracle:
- It allows calling functions and procedures with keyword arguments.
- Query results will be put into Record objects, where database fields are accessible as object attributes.
- The Connection class provides methods for iterating through the database metadata.
- Importing the modules adds support for URLs with the scheme oracle to ll.url.
- ll.ul4c is compiler for a templating language with similar capabilities to Django’s templating language. UL4 templates are compiled to an internal bytecode format, which makes it possible to implement template renderers in other languages and makes the template code “secure” (i.e. template code can’t open or delete files).
- ll.astyle can be used for colored terminal output (via ANSI escape sequences).
- ll.color provides classes and functions for handling RGB color values. This includes the ability to convert between different color models (RGB, HSV, HLS) as well as to and from CSS format, and several functions for modifying and mixing colors.
- ll.misc provides several small utility functions and classes.
- ll.sisyphus provides classes for running Python scripts as cron jobs.
- ll.daemon can be used on UNIX to fork a daemon process.
- ll.xml_codec contains a complete codec for encoding and decoding XML.
- ll.nightshade can be used to serve the output of PL/SQL functions/procedures with CherryPy.
Changes in 3.8 (released 06/15/2010)
The parsing infrastructure has been completely rewritten to be more modular and to support iterative parsing (similar to ElementTree).
Now parsing XML is done in a pipelined approach that looks like this:
>>> from ll.xist import xsc, parse >>> from ll.xist.ns import html >>> doc = parse.tree( ... parse.String("<a href='http://www.python.org/'>Python</a>") ... parse.Expat() ... parse.NS(html) ... parse.Node(pool=xsc.Pool(html)) ... ) >>> doc.bytes() '<a href="http://www.python.org/">Python</a>'
Iterative parsing looks like this:
>>> from ll.xist import xsc, parse >>> from ll.xist.ns import xml, html, chars >>> for (evtype, path) in parse.itertree( ... parse.URL("http://www.python.org/"), ... parse.Expat(ns=True), ... parse.Node(pool=xsc.Pool(xml, html, chars)), ... filter=html.a/html.img ... ): ... print path[-1].attrs.src, "-->", path[-2].attrs.href http://www.python.org/images/python-logo.gif --> http://www.python.org/ http://www.python.org/images/trans.gif --> http://www.python.org/#left%2Dhand%2Dnavigation http://www.python.org/images/trans.gif --> http://www.python.org/#content%2Dbody http://www.python.org/images/donate.png --> http://www.python.org/psf/donations/ http://www.python.org/images/worldmap.jpg --> http://wiki.python.org/moin/Languages http://www.python.org/images/success/tribon.jpg --> http://www.python.org/about/success/tribon/
The XIST element ll.xist.ns.specials.z has been moved to the ll.xist.ns.doc module.
The function ll.xist.xsc.docprefixes has been dropped. A new function ll.xist.xsc.docpool has been added.
The module ll.xist.parsers has been renamed to parse.
The module ll.xist.presenters has been renamed to present.
The classes ll.xist.converters.Converter and ll.xist.publishers.Publisher has been moved to ll.xist.xsc. The modules ll.xist.converters and ll.xist.publishers no longer exist.
The walk methods walknode and walkpath have been renamed to walknodes and walkpaths and the implemention has been moved from the nodes classes into WalkFilter. WalkFilter has been moved to ll.xist.xfind.
A new selector has been added to ll.xist.xfind: AnySelector outputs all nodes.
Added a new function misc.module that creates a module from source code.
ll.url.Path has been simplified: Path segments are strings instead of tuples now.
The old URL method import_ has been removed. The new function misc.module can now be used for that.
The two classes ll.make.PoolAction and ll.make.XISTPoolAction have been dropped. You can use make.ObjectAction(misc.Pool).call() and make.ObjectAction(xsc.Pool).call() for that.
The class XISTParseAction has been removed. This action can be replaced by a combination of ObjectAction, CallAction and CallAttrAction.
Two new UL4 functions abs and utcnow have been added.
A few methods have been added to UL4 date objects: mimeformat, day, month, year, hour, minute, second, microsecond, weekday and yearday.
Use autoboxing in the Java code generated by ll.xist.ns.jsp.fromul4.
The code has switched to using the format method instead of using the % operator everywhere.
ssh URLs in ll.url now use the standalone execnet package.
ssh URLs now support a nice argument instead of ssh_config.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|ll_xist-3.8-py2.6-macosx-10.4-i386.egg (834.9 kB) Copy SHA256 hash SHA256||Egg||2.6||Jun 15, 2010|
|ll_xist-3.8-py2.6-win32.egg (891.2 kB) Copy SHA256 hash SHA256||Egg||2.6||Jun 16, 2010|
|ll-xist-3.8.tar.bz2 (358.8 kB) Copy SHA256 hash SHA256||Source||None||Jun 15, 2010|
|ll-xist-3.8.tar.gz (424.6 kB) Copy SHA256 hash SHA256||Source||None||Jun 15, 2010|
|ll-xist-3.8.win32-py2.6.exe (656.8 kB) Copy SHA256 hash SHA256||Windows Installer||2.6||Jun 16, 2010|
|ll-xist-3.8.zip (494.2 kB) Copy SHA256 hash SHA256||Source||None||Jun 15, 2010|