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.2.tar.gz (29.5 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.2-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyhtml_enhanced-2.3.2.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.2.tar.gz
Algorithm Hash digest
SHA256 217214fcf9b6e47329c3769d5946ec607c279f941993d8f2f1cdebf67b4e0db7
MD5 109dea1028df9834cdb41868109da719
BLAKE2b-256 3a3dd2935c9a8949b7305b2967ee3c25cec8ac357b25bb323fe6f5c824b05a41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyhtml_enhanced-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a407c8bf2bd47e0689f045c9635c8078ad43da84cfe1120a3e393ac893cdb221
MD5 b54c5ec0e61e4d59db831f1b5cf9653a
BLAKE2b-256 9a0064e0f487d80dbed2cf08d4e742a7916d481a3a970d815c320f870ca16cf9

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