Skip to main content

Python binding for the libtidy C library.

Project description

libtidy

Python binding for the libtidy C library.

Overview

Python libtidy module is a low-level binding for libtidy C library.
It is an effort to allow python programs full access to the API implemented and provided by the well known *libtidy* library.

PyPI record.

Documentation.

libtidy is a lightweight Python package, based on the ctypes library.
It is fully compliant implementation of the original C libtidy API by implementing whole its functionality in a clean Python instead of C.

libtidy API documentation can be found at:

libtidy API Reference

libtidy uses the underlying libtidy C shared library as specified in libtidy.cfg (included libtidy-X.X.* is the default), but there is also ability to specify it programmatically by one of the following ways:

import libtidy
libtidy.config(LIBTIDY="libtidy C shared library absolute path")
# or
libtidy.config(LIBTIDY=None)  # included libtidy-X.X.* will be used

About original libtidy:

Borrowed from the original website:

libtidy Introduction

libtidy is the library version of HTML Tidy. In fact, Tidy is libtidy; the console application is a very simple C application that links against libtidy. It’s what powers Tidy, mod-tidy, and countless other applications that perform tidying.

Design factors

libtidy is Thread Safe and Re-entrant. Because there are many uses for HTML Tidy - from content validation, content scraping, conversion to XHTML - it was important to make libtidy run reasonably well within server applications as well as client side.

Requirements

  • It is a fully independent package.
    All necessary things are installed during the normal installation process.
  • ATTENTION: currently works and tested only for Windows.

Installation

Prerequisites:

To install run:

python -m pip install --upgrade libtidy

Development

Prerequisites:

  • Development is strictly based on tox. To install it run:

    python -m pip install --upgrade tox

Visit Development page.

Installation from sources:

clone the sources:

git clone https://github.com/karpierz/libtidy.git libtidy

and run:

python -m pip install ./libtidy

or on development mode:

python -m pip install --editable ./libtidy

License

Copyright (c) 2024-2024 Adam Karpierz
Licensed under the HTML Tidy License
Please refer to the accompanying LICENSE file.

Authors

Changelog

5.9.14a1 (2024-10-10)

  • First release.

0.0.0 (2024-10-10)

  • Initial commit.

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

libtidy-5.9.14a1.zip (615.0 kB view details)

Uploaded Source

Built Distribution

libtidy-5.9.14a1-py3-none-any.whl (596.1 kB view details)

Uploaded Python 3

File details

Details for the file libtidy-5.9.14a1.zip.

File metadata

  • Download URL: libtidy-5.9.14a1.zip
  • Upload date:
  • Size: 615.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for libtidy-5.9.14a1.zip
Algorithm Hash digest
SHA256 d169c12ad85a2cd19ec2858180d0228cadb1f832a97e1c156f366c924cf61d9d
MD5 a502b16b47485dc678185866a3a24621
BLAKE2b-256 588d3673b90f60ef2cd1d62895686c468a14dda1fd9513e0147ee1f317a84d9f

See more details on using hashes here.

File details

Details for the file libtidy-5.9.14a1-py3-none-any.whl.

File metadata

  • Download URL: libtidy-5.9.14a1-py3-none-any.whl
  • Upload date:
  • Size: 596.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for libtidy-5.9.14a1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c518a4a47f91255775ddf6c9c0052350ba6e7b482ec60cf3252d4b190d423a0
MD5 8cea8b740f296bb4b73adf0e674e521a
BLAKE2b-256 93646ebb5ae567f71c35ae0d3252def6eec765597d352289b9c8ffe1e079d588

See more details on using hashes here.

Supported by

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