Simple HTML5 document builder.
Project description
HTML5Builder
HTML5Builder is a Python module for simply generating strings of HTML5 documents and document fragments.
Requirement
- Python 2.7 or above
Installation
pip install html5builder
Basic Usage
>>> from html5builder import HTML5Builder
>>> tag = HTML5Builder()
>>> img = tag.img(src='image.jpg')
>>> str(img)
'<img src="image.jpg">'
>>> anchor = tag.a([img, 'link'], cls='link', href='target.html')
>>> str(anchor)
'<a href="target.html" class="link"><img src="image.jpg">link</a>'
>>> div = tag.div()
>>> div.child.append(anchor)
>>> str(div)
'<div><a href="target.html" class="link"><img src="image.jpg">link</a></div>'
>>> doc = tag.html([tag.head(''), tag.body('')], lang='ja')
>>> str(tag.doctype + str(doc))
'<!DOCTYPE html><html lang="ja"><head></head><body></body></html>'
Documentation
Documentation is available online.
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
html5builder-0.1.0.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file html5builder-0.1.0.tar.gz.
File metadata
- Download URL: html5builder-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfb6e87aafef1b5da2e55f2055e549e12e44e0db561a36ac93a5f496eefd9604
|
|
| MD5 |
140766a4ef205fbf78bd55303084d2dd
|
|
| BLAKE2b-256 |
a8c8e87a5f6c7920519b66af1f09b380e634f6f20954bed282019c91a05f1c77
|
File details
Details for the file html5builder-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: html5builder-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f05f61800763c53e21cd4641578ac897b82a15797c23ea49fad169bafcdd5825
|
|
| MD5 |
6d1aefecd55fa209561cbe9488900be8
|
|
| BLAKE2b-256 |
83af52343266c31c774ee8657eb063fd368e4dd2bdc688a350edcc0daeadd4e1
|