Tool for generating HTML and XML documents
Project description
XMLTag — tool for easy creating XML and HTML documents in the Python style. Idea was taked form yattag, but xmltag offers an improved features with less code (really, api is very small, just see source code).
Installation
$ pip install xmltag
Usage example
from xmltag import HTMLDocument
doc = HTMLDocument()
with doc.head():
doc.title('Document')
with doc.body():
doc.h1('Helo world!', class_="heading")
users = ['Marry', 'John', 'Bob']
with doc.ul(id='user-list'):
for name in users:
doc.li(name)
print(doc.render())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xmltag-1.2.0.tar.gz
(3.3 kB
view hashes)