| 1 |
Metadata-Version: 1.1 |
| 2 |
Name: pytidylib |
| 3 |
Version: 0.3.2 |
| 4 |
Summary: Python wrapper for HTML Tidy (tidylib) on Python 2 and 3 |
| 5 |
Home-page: http://countergram.com/open-source/pytidylib/ |
| 6 |
Author: Jason Stitt |
| 7 |
Author-email: [email protected] |
| 8 |
License: UNKNOWN |
| 9 |
Description: `PyTidyLib`_ is a Python package that wraps the `HTML Tidy`_ library. This |
| 10 |
allows you, from Python code, to "fix" invalid (X)HTML markup. Some of the |
| 11 |
library's many capabilities include: |
| 12 |
|
| 13 |
* Clean up unclosed tags and unescaped characters such as ampersands |
| 14 |
* Output HTML 4 or XHTML, strict or transitional, and add missing doctypes |
| 15 |
* Convert named entities to numeric entities, which can then be used in XML |
| 16 |
documents without an HTML doctype. |
| 17 |
* Clean up HTML from programs such as Word (to an extent) |
| 18 |
* Indent the output, including proper (i.e. no) indenting for ``pre`` elements, |
| 19 |
which some (X)HTML indenting code overlooks. |
| 20 |
|
| 21 |
Changes |
| 22 |
======= |
| 23 |
|
| 24 |
* 0.3.2: Initialization bug fix |
| 25 |
|
| 26 |
* 0.3.1: find_library support while still allowing a list of library names |
| 27 |
|
| 28 |
* 0.3.0: Refactored to use Tidy and PersistentTidy classes while keeping the |
| 29 |
functional interface (which will lazily create a global Tidy() object) for |
| 30 |
backward compatibility. You can now pass a list of library names and base |
| 31 |
options when instantiating Tidy. The keep_doc argument is now deprecated |
| 32 |
and does nothing; use PersistentTidy. |
| 33 |
|
| 34 |
* 0.2.4: Bugfix for a strange memory allocation corner case in Tidy. |
| 35 |
|
| 36 |
* 0.2.3: Python 3 support (2 + 3 cross compatible) with passing Tox tests. |
| 37 |
|
| 38 |
Small example of use |
| 39 |
==================== |
| 40 |
|
| 41 |
The following code cleans up an invalid HTML document and sets an option:: |
| 42 |
|
| 43 |
from tidylib import tidy_document |
| 44 |
document, errors = tidy_document('''<p>fõo <img src="bar.jpg">''', |
| 45 |
options={'numeric-entities':1}) |
| 46 |
print document |
| 47 |
print errors |
| 48 |
|
| 49 |
Docs |
| 50 |
==== |
| 51 |
|
| 52 |
Documentation is shipped with the source distribution and is available at |
| 53 |
the `PyTidyLib`_ web page. |
| 54 |
|
| 55 |
.. _`HTML Tidy`: http://tidy.sourceforge.net/ |
| 56 |
.. _`PyTidyLib`: http://countergram.com/open-source/pytidylib/ |
| 57 |
|
| 58 |
Platform: UNKNOWN |
| 59 |
Classifier: Development Status :: 5 - Production/Stable |
| 60 |
Classifier: Environment :: Other Environment |
| 61 |
Classifier: Intended Audience :: Developers |
| 62 |
Classifier: License :: OSI Approved :: MIT License |
| 63 |
Classifier: Programming Language :: Python |
| 64 |
Classifier: Programming Language :: Python :: 3 |
| 65 |
Classifier: Natural Language :: English |
| 66 |
Classifier: Topic :: Utilities |
| 67 |
Classifier: Topic :: Text Processing :: Markup :: HTML |
| 68 |
Classifier: Topic :: Text Processing :: Markup :: XML |