Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Write html to a file like object, using a pythonic syntax.

Project Description

htmlwrite is a python library for writing html to a file like object, using a pythonic syntax. Use as an alternative to templating engines.

>>> import sys
>>>
>>> from htmlwrite import Writer, Tag
>>>
>>> writer = Writer(sys.stdout)
>>> w = writer.write
>>> c = writer.context
>>>
>>> with c(Tag('html')):
...     with c(Tag('body')):
...         with c(Tag('div', class_=('foo', ), s_font_weight='bold')):
...             w('Hello world  ')
...         w(Tag('div', c=('ok, bye.', )))
...
<html>
  <body>
    <div class="foo" style="font-weight: bold;">
      Hello world
    </div>
    <div>ok, bye.</div>
  </body>
</html>
Release History

Release History

This version
History Node

0.5.0

History Node

0.4.0

History Node

0.3.0

History Node

0.2.0

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
htmlwrite-0.5.0.tar.gz (5.3 kB) Copy SHA256 Checksum SHA256 Source Feb 22, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting