Skip to main content

Add your description here

Project description

any2htpy

any2htpy is a principled converter for htpy inspired by html2htpy, a built-in tool in htpy.

Unlike html2htpy any2htpy uses a feature-complete HTML parser called justhtml.

Features

  • adheres to SVG and MathML
  • can adjust for malformed HTML
  • properly keeps whitespace for preserving tags

Usage

usage: any2htpy [-h] [--input INPUT] [--stdin] [--debug] [--fragment]

options:
  -h, --help     show this help message and exit
  --input INPUT  input as string or file
  --stdin        use stdin as input
  --debug        generate debug output
  --fragment     use htpy fragment[]

input through stdin

[me@machine ] echo "<p>Hello World</p>" | uv run any2htpy --stdin --prefix htpy
htpy.p["Hello World"]

Disclaimer

As an AI-skeptic, specifically regarding code and software in general, justhtml is not exactly the obvious choice or more precisely the exact opposite one. However, the heavy test-rig with thousands of tests and the use as a parser without introducing it as a dependency in the resulting code make it a better choice than any other native Python parser library.

License

Licensed under the terms of the MIT License

Copyright

Copyright (c) 2026 Hartmut Seichter

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

any2htpy-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

any2htpy-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file any2htpy-0.1.0.tar.gz.

File metadata

  • Download URL: any2htpy-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for any2htpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4138a29656cbb74f04cc656a34679baf0416376f061678e757137d6bf0fa3bc
MD5 5fed59f11e5040855d9d7bfd2762f390
BLAKE2b-256 28ab10bd4bd26bb0e9dbb860db760c53055f8a2a4f99e121185ea0afa1976ce5

See more details on using hashes here.

File details

Details for the file any2htpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: any2htpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for any2htpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e51b5dd7b808f386da1c56f66ea2150a93726cf348b9d6ab9578e3bfceeb06ad
MD5 4699cd60b7b044174bb21e654c7993b4
BLAKE2b-256 42db48617741a07934a57d8441c1cd007fef3ee9260c857957365b808c2d7be2

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