Skip to main content

html-dsl

A HTML-DSL for Python

CI

USE

>>> from html_dsl.elements import BaseHtmlElement
>>> from html_dsl.common import HTML, BODY, H1, P, DIV, SPAN
>>> html = HTML[
        BODY[
            H1["Title"],
            P(color="yellow")[
                "Hello, World.", SPAN["something in span"], "Out of the span"
            ],
            P["This is the second paragraph."],
            DIV[
                DIV(_class="row")[
                    DIV(_class="column", color="red")["col1"],
                    DIV(_class="column", color="blue")["col2"],
                    DIV(_class="column", color="green")["col3"],
                ]
            ],
        ]
    ]
>>> print(html)
<html>
  <body>
    <h1>
    Title
    </h1>
    <p color="yellow">
    Hello, World.
      <span>
      something in span
      </span>
    Out of the span
    </p>
    <p>
    This is the second paragraph.
    </p>
    <div>
      <div class="row">
        <div color="red" class="column">
        col1
        </div>
        <div color="blue" class="column">
        col2
        </div>
        <div color="green" class="column">
        col3
        </div>
      </div>
    </div>
  </body>
</html>

Install

pip install html_dsl

Author

Yixian Du

Metadata

Release files for html_dsl 0.5.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 html_dsl 0.5.0
File Size Uploaded
html_dsl-0.5.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for html_dsl 0.5.0
File Interpreter ABI Platform
html_dsl-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / html_dsl-0.5.0.tar.gz

Download URL html_dsl-0.5.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
36c0439b799dc936008129b783940431003889597a985164bce82d95eb74adf4
BLAKE2b-256 checksum
How to use checksums
348ffc2701721770580fc6e709ce17188e9ef53a7af9d879aa0612833c919e01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.8.18 Linux/6.2.0-1018-azure

Release files / html_dsl-0.5.0-py3-none-any.whl

Download URL html_dsl-0.5.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ede301cd9a7f61fc0140919ca0cee26e6eca396633df79b66e6d3238e0b375c
BLAKE2b-256 checksum
How to use checksums
307feaf18276113166de86e0c09624674ca7e57cb25dccb03229e046be3b45df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.8.18 Linux/6.2.0-1018-azure

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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