Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #251

Genshi Compiler - Speed up your XML templates

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <viktor@ferenczi.eu>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'pypi': 0.04; 'memory.': 0.05; 'compiler': 0.07; 'python': 0.08; 'url:pypi': 0.08; '0.1.1': 0.16; 'certainly.': 0.16; 'entry:': 0.16; 'genshi': 0.16; 'home:': 0.16; 'license:': 0.16; 'notably': 0.16; 'stream.': 0.16; 'subject:Speed': 0.16; 'subject:XML': 0.16; 'x-mailer:evolution 2.30.3': 0.16; 'template': 0.19; 'tree': 0.19; 'code.': 0.22; 'url:code': 0.23; 'code': 0.24; 'url:wiki': 0.25; 'parameters': 0.25; 'xml': 0.25; 'function': 0.26; "i'm": 0.27; 'guess': 0.28; 'depends': 0.28; 'compile': 0.29; 'object': 0.30; 'module': 0.30; 'far,': 0.30; 'separately.': 0.30; 'usable': 0.30; 'source': 0.32; 'url:downloads': 0.32; 'typically': 0.33; 'initial': 0.33; 'there': 0.34; 'test': 0.34; 'project': 0.35; 'announce': 0.36; 'url:python': 0.37; 'element': 0.37; 'to:addr:python-announce- list': 0.37; 'anything': 0.37; 'some': 0.37; 'doing': 0.37; 'using': 0.37; 'received:192': 0.38; 'url:org': 0.38; 'received:192.168.1': 0.39; 'header:Mime-Version:1': 0.39; 'allows': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'url:p': 0.63; 'pleased': 0.63; 'according': 0.63; 'here:': 0.64; 'cost': 0.65; 'received:109': 0.74; 'subject:your': 0.80; 'received:hu': 0.91; 'render': 0.91
Subject Genshi Compiler - Speed up your XML templates
From Ferenczi Viktor <viktor@ferenczi.eu>
To Python Announce <python-announce-list@python.org>
Content-Type text/plain; charset="UTF-8"
Date Sun, 17 Jul 2011 01:00:52 +0200
Mime-Version 1.0
X-Mailer Evolution 2.30.3
Content-Transfer-Encoding 7bit
X-Mailman-Approved-At Sun, 17 Jul 2011 15:52:51 +0200
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
Approved python-announce-list@python.org
Newsgroups comp.lang.python.announce
Message-ID <mailman.1169.1310910773.1164.python-announce-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1310910773 news.xs4all.nl 23979 [2001:888:2000:d::a6]:52034
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python.announce:251

Show key headers only | View raw


Genshi Compiler 0.1.1
=====================

I'm pleased to announce the first public release of Genshi Compiler!

Project  home: http://code.google.com/p/genshi-compiler/
Download here: http://code.google.com/p/genshi-compiler/downloads/

PyPI entry: http://pypi.python.org/pypi/genshi_compiler

License: MIT software license

Quality: Beta with good unit test coverage

Genshi Compiler allows for rendering your Genshi template to Python
source code. You can save the code as a Python module or compile it into
a directly usable module object in memory. Just call the render function
on the module with your template parameters to render the whole template
or any of your template functions to render those fragments separately.

According to my initial benchmarks the rendering speed is typically ~40x
faster than doing the same using Genshi. There is a cost of this
speedup, certainly. Some of Genshi's dynamic features are not available,
most notably anything that depends on a template loader (xi:include),
the XML element tree representation (py:match) or the token stream.

If you've read this far, then I guess you want to see the tutorial:
http://code.google.com/p/genshi-compiler/wiki/tutorial

Regards,
Viktor Ferenczi

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

Genshi Compiler - Speed up your XML templates Ferenczi Viktor <viktor@ferenczi.eu> - 2011-07-17 01:00 +0200

csiph-web