HTMLTemplate

What is HTMLTemplate?

HTMLTemplate converts HTML/XHTML templates into simple Python object models that can be manipulated through callback functions in your scripts. Fast, powerful and easy to use.

Some advantages:

Total separation of markup and code
HTML templates can be edited using your favourite HTML editor and previewed in web browsers. Control code can be written and maintained with your favourite Python editor. Special tag attributes indicate which HTML elements should be converted into nodes within the object model. Absolutely no code is kept in the HTML markup, not even presentation logic.
Simple, practical API
HTMLTemplate's powerful, highly-refined interface is designed for simplicity and ease of use, yet without compromising power and flexibility. Its API is defined as just four public classes containing less than a dozen properties and methods.
Allows component-based construction
Rendered pages can be constructed from a single large template or composed from several smaller ones. Generated content can be reused whole or in-part.
Doesn't get in your face
Lightweight design, strictly KISS. No boilerplate code required. Strong emphasis on ease of use.
Free
Released under MIT Licence, allowing use in both open and closed-source projects.

Full documentation, tutorials and example scripts are included in the HTMLTemplate package.

Installation

Download the latest .tar.gz source release from the Python Package Index and follow the instructions in its README file.

Examples