HyperText with Python
Project description
Hyperscript
Hyperscript is a lightweight library that allows you to write HTML with Python. It is heavily inspired by HyperScript.
Example usage
>>> print(h("p", "Hello world!"))
<p>Hello world!</p>
Class and id selectors
>>> print(h("p.class1#id", "Hello world!"))
<p class="class1" id="id">Hello world!</p>
Style
>>> print(h("p", "Hello world!", {"style": {"color": "red"}}))
<p style="color: red">Hello world!</p>
Nesting elements
>>> print(h("div", h("p", "Hello world!")))
<div><p>Hello world!</p></div>
Properties
>>> print(h("a", {"href": "https://www.example.com"}, "link"))
<a href="https://www.example.com">link</a>
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
hyperscript-0.0.4.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for hyperscript-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c049e99d0b37fc3d488d6c142b2a1db7289f375790b044b5edf5d51ae339edc |
|
MD5 | a7a28a06bcf616115104500426a93c01 |
|
BLAKE2b-256 | af673e1eda5951e6c1a24a984c4fb9d97c83b69b154ce0d782269909242d3cbf |