Easy HTML
Generate HTML using python and also convert to PDF.
Installation
pip install py-easy-html
Getting started
General usage
h1 = generate_tag('h1', body='This is a h1', class_name="your_class", id_name="your_id", self_closing=False)
Output
<h1 class="your_class" id="your_id">This is a h1</h1>
<!-- With self_closing=True -->
<h1 class="your_class" id="your_id" />
You can also do nested tags
h1 = generate_tag('h1', body=generate_tag('span', body='Span inside h1'))
Output
<h1>
<span>Span inside h1</span>
</h1>
And also multiple nested tags
h1 = generate_tag(
'h1',
style={
"display": "flex",
"justify-content": "space-between",
"align-items": "center",
},
body=[
generate_tag('span', body='First Span'),
generate_tag('span', body='Second'),
],
)
Output
<h1 style="display: flex;justify-content: space-between;align-items: center;">
<span>First Span</span>
<span>Second</span>
</h1>
Metadata
Release files for py-easy-html 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py-easy-html-0.0.2.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_easy_html-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / py-easy-html-0.0.2.tar.gz
| Download URL | py-easy-html-0.0.2.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52d1fc19d22d76abd392e047bc9668f1c2922f6cfd619902782ff1fd1ff271e2
|
|
BLAKE2b-256 checksum How to use checksums |
4dbdc72c37765cbb3a695b3c1889243527464dd60cb602375dbc21f267e730d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.0
|
Release files / py_easy_html-0.0.2-py3-none-any.whl
| Download URL | py_easy_html-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4c7bfddf732c4a04f6140361239b8efbca2ef6285d8af8c1dc19073c48bb32a
|
|
BLAKE2b-256 checksum How to use checksums |
3bb2fd5a1abd6ec17d48adf239203b4bec16a7ad587f99996c6118c5a796312f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.0
|