Skip to main content

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'), 'ok, bye.')
...
<html>
  <body>
    <div class="foo" style="font-weight: bold;">
      Hello world
    </div>
    <div>ok, bye.</div>
  </body>
</html>

Metadata

Release files for htmlwrite 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for htmlwrite 0.7.0
File Size Uploaded
htmlwrite-0.7.0.tar.gz 6.6 kB Details

Release files / htmlwrite-0.7.0.tar.gz

Download URL htmlwrite-0.7.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1241542aac4a515daf88aba86d46482edd0a8b1e736e20fc90afd88a722797e2
BLAKE2b-256 checksum
How to use checksums
9335142543f5cf7d705e6c725fd9d2f91ab5c3702e4df65d0a3a2795bc4d2c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release history Release notifications | RSS feed

This release

0.7.0 This release

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page