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
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
hyperscript-0.0.3.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for hyperscript-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c176ebb07fe7ea4252e70da366ffa98b55f255f9e56dda534290a1ead13dcc9 |
|
MD5 | 76bdf73c99f5db94f2966afb304ca107 |
|
BLAKE2b-256 | 7f581c8d41fcb029a1c2fd9e30f1f3028593df53df8b589fd08a755e8aacbdf3 |