smartpy is cool ... but hypy is hype ;-)
History
Few years ago, i've discovered Smarty for php, and was totally amazed by all the concepts of this templating engine.With python, i had never found a templating engine as powerful as smarty. In the fabulous python world, there are a lot of engines (quixote, kid, cheetah, cherrytemplate, tal, ptp, simpletal ...), but no one comes with all the simple and good concepts that i've found in smarty.
So i decided to build my own simple smarty-like template engine, which i named smartpy.
Features
Smartpy do :- implement some template "blocks command" (foreach, if/else, capture, include)
- implement the concept of "modifiers command" (and "functions command" too)
- plugins (really easy to add its own block/function/modifiers command)
- caching engine (but it should be easy to implement)
- doesn't "compile" template
- not fully compatible with the real smarty
Compare to
Smartpy compares to all others python template engines (the first 2 points are the most important):- a simple, very simple, template engine (1 module of 250 lines of code : easy to hack if needed, or easy to transpose to another language)
- very easy to add its own "block/function/modifiers" as plugins
- implement only the minimum commands (with them, you can do all)
- is not xml-oriented or attribut-oriented, you can template all kinds of strings
- templates are not obscufated with python code or complex syntax ! Smart[p]y language is simple and doesn't break the html code in a wysiwyg editor.
Download
Download SmartPy (GPL)Documentation
Look a test.py file (in the tar.gz):- it implements some "user plugins" (herits from Plugins)
- and use a test template, with all features covered
Marc - 11 / 01 / 2006