Skip to main content

A library for building HTML documents with a simple and learnable syntax

Project description

<PyHTML/>

A library for building HTML documents with a simple and learnable syntax, inspired by (and similar to) Cenk Altı's PyHTML library, but with improved documentation and type safety.

Learn more by reading the documentation, or try it out online!

Features

  • Inline documentation and type safety for all tags.

  • Editor support for many common tags (attribute suggestions).

  • A modern and readable codebase.

  • 100% test coverage.

Usage

>>> import pyhtml as p
>>> my_website = p.html(
...     p.head(
...         p.title("Hello, world!"),
...         p.script(src="http://example.com/script.js"),
...     ),
...     p.body(
...         p.h1("Hello, world!"),
...         p.p("This is my amazing website!"),
...     ),
... )
>>> print(str(my_website))
<!DOCTYPE html>
<html>
  <head>
    <title>
      Hello, world!
    </title>
    <script type="text/javascript" src="http://example.com/script.js"></script>
  </head>
  <body>
    <h1>
      Hello, world!
    </h1>
    <p>This is my amazing website!</p>
  </body>
</html>

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

pyhtml_enhanced-2.3.1.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyhtml_enhanced-2.3.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file pyhtml_enhanced-2.3.1.tar.gz.

File metadata

  • Download URL: pyhtml_enhanced-2.3.1.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyhtml_enhanced-2.3.1.tar.gz
Algorithm Hash digest
SHA256 bd83b6c74c205630e6191f8c6d24668a2ad25594a75d426e305565fc80269094
MD5 13709ee27cb69db0f6bd84c49be4c876
BLAKE2b-256 9e09d02c1912b9049bb0fc72faa535309a40626c13608a894c479ce8e2fc39f8

See more details on using hashes here.

File details

Details for the file pyhtml_enhanced-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: pyhtml_enhanced-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyhtml_enhanced-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c19be65320da1548ccf78e5b8662e9e4ccd16ffa76bd0eb236b2158e99d3c69f
MD5 b0044a527732a4a7beb37a11a77eb976
BLAKE2b-256 6c15faef54cdba3a95cdfecc3eca40b511665dc722d640b6895374abdf344703

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page