Skip to main content

Tool for generating HTML and XML documents

Project description

https://img.shields.io/pypi/v/xmltag.svg https://travis-ci.org/zenwalker/python-xmltag.svg https://coveralls.io/repos/github/zenwalker/python-xmltag/badge.svg

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


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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page