Skip to content

nijel/utidylib

Folders and files

NameName
Last commit message
Last commit date
Jan 27, 2025
Mar 3, 2025
Mar 5, 2024
Mar 5, 2024
Mar 5, 2024
Mar 5, 2024
Mar 5, 2024
May 2, 2021
Mar 5, 2024
Oct 15, 2018
May 2, 2021
Mar 5, 2024
Mar 5, 2024
Aug 13, 2014
Mar 20, 2025
May 2, 2021
May 2, 2021
Mar 5, 2024
Mar 5, 2024

Repository files navigation

uTidylib

Build Status Coverage Status Documentation PyPI - Version

This is uTidylib, the Python wrapper for the HTML cleaning library named TidyLib. It supports both original Tidy <http://tidy.sf.net> and new HTML5 enabled Tidy <http://www.html-tidy.org/>.

The package is available on PyPI <https://pypi.org/project/uTidylib/>.

Once installed, there are two ways to get help. The simplest is:

$ python
>>> import tidy
>>> help(tidy)
. . .

Then, of course, there's the API documentation, which is available at <https://utidylib.readthedocs.io/en/latest/>.

10 Second Tutorial

>>> import tidy
>>> print(
...     tidy.parseString(
...         "<Html>Hello Tidy!",
...         output_xhtml=1,
...         add_xml_decl=1,
...         indent=1,
...         tidy_mark=0,
...         doctype="transitional",
...     )
... )
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
  </head>
  <body>
    Hello Tidy!
  </body>
</html>

Good luck!