Skip to main content

Writing XML with Pythonic code

https://img.shields.io/github/license/mashape/apistatus.svg https://badge.fury.io/py/pytohtml.svg

Installation

$ pip install pytohtml

Example

https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/597237/436215da-f815-4473-687e-7fc21b04bab3.gif

QR-Code Generator Source Code.

https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/597237/40173212-8f2e-0e4e-c924-3140d6ff1722.gif

Simple Chat Source Code.

Syntax

from py2html.elements import html, head, body, meta, title, h1


print(
    html(lang="en")[
        head[
            meta(charset="UTF-8"),
            meta({"http-equiv": "X-UA-Compatible", "content": "IE=edge"}),
            meta(name="viewport", content="width=device-width, initial-scale=1.0"),
            title["py2html"]
        ],
        body[
            h1[
                "Hello, Py2HTML!"
            ]
        ]
    ].render()
)

*formatted output

<html lang="en">
<head>
<meta charset="UTF-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
<title>py2html</title>
</head>
<body>
<h1>Hello, Py2HTML!</h1>
</body>
</html>

Metadata

Release files for pytohtml 1.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytohtml 1.2.6
File Size Uploaded Provenance Actions
pytohtml-1.2.6.tar.gz 59.1 kB Without provenance Details for pytohtml-1.2.6.tar.gz

Release files / pytohtml-1.2.6.tar.gz

Download URL pytohtml-1.2.6.tar.gz
Size 59.1 kB
Tags Source
SHA-256 checksum
How to use checksums
32776b1312f2bb9aaf75fbb6b20aa1bb0428b8a8accbbdb9c3ed355fe74b0b71
BLAKE2b-256 checksum
How to use checksums
b752805f7d776ecf4355fd4ad5b4474dd07c1b9c0afa2f797006d2fb4a8f9be5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Security for pytohtml 1.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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