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.

Files for xmltag, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size xmltag-1.2.0.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page