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.0.tar.gz (28.9 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.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyhtml_enhanced-2.3.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.0.tar.gz
Algorithm Hash digest
SHA256 3a602bbbfa1aacdf868b6cba9581a5673176495de45a292577931873b85374f4
MD5 2c2c47ed461e2dc2bb922538d88f5e26
BLAKE2b-256 1c387ed2ef969d0bcdb8d3b8d21ac6638f50c40ee3d0c9cb368adb5380e66d7f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyhtml_enhanced-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86839e796de778828130aea2baf1d4478f2288c0c50233454494e2eb664ba17b
MD5 1d9367ebc5cca251a25b754127a79403
BLAKE2b-256 ca1dec3b39b239bd8e0afe43262f4c1049d0276951ef6a85a58ce124ca8a86cd

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