{ "info": { "author": "Bernard Yue", "author_email": "html5print@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", "Topic :: System", "Topic :: Text Processing", "Topic :: Text Processing :: Markup", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Utilities" ], "description": "HTML5 Pretty Print\n==================\nThis tool pretty print your HTML, CSS and JavaScript file. The package comes\nwith two parts:\n\n * a command line tool, ``html5-print``\n * a python module, ``html5print``\n\n.. image:: https://travis-ci.org/berniey/html5print.png?branch=master\n :target: https://travis-ci.org/berniey/html5print\n\n.. image:: https://img.shields.io/badge/version-latest-brightgreen.svg?style=plastic\n :target: https://pypi.python.org/pypi/html5print/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/badge/doc-0.1.2-brightgreen.svg?style=plastic\n :target: https://pythonhosted.org/html5print/\n :alt: Documentation\n\n.. image:: https://img.shields.io/badge/source-latest-blue.svg?style=plastic\n :target: https://github.com/berniey/html5print\n :alt: Source Code\n\n.. image:: https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=plastic\n :target: https://raw.githubusercontent.com/berniey/html5print/master/LICENSE\n :alt: License\n\n\nIntroduction\n------------\n\nThis module reformat web page code and make it more readable. It is targeted\nfor developers, hence is not optimized for speed. I start out looking for a\ntool, ended up created this module. Hope it helps you!\n\nKey features:\n\n * Pretty print HTML as well as embedded CSS and JavaScript within it\n * Pretty print pure CSS and JavaScript\n * Try to fix fragmented HTML5\n * Try to fix HTML with broken unicode encoding\n * Try to guess encoding of the document, and in some cases manage\n to convert 8-bit byte code back into correct UTF-8 format\n * Support both Python 2 and 3\n\n\nInstallation\n------------\n\n.. code-block:: sh\n\n $ [sudo] pip install html5print\n\nUninstallation\n--------------\n\n.. code-block:: sh\n\n $ [sudo] pip uninstall html5print\n $ [sudo] pip uninstall bs4 html5lib slimit tinycss2 requests chardet\n\n\nCommand Line Tool\n-----------------\n\nSynopsis\n********\n\n.. code-block:: sh\n\n $ html5-print --help\n usage: html5-print [-h] [-o OUTFILE] [-s INDENT_WIDTH] [-e ENCODING]\n [-t {html,js,css}] [-v]\n infile\n\n Beautify HTML5, CSS, JavaScript - Version 0.1.2 (By Bernard Yue)\n This tool reformat the input and return a beautified version,\n in unicode.\n\n positional arguments:\n infile filename | url | -, a dash, which represents stdin\n\n optional arguments:\n -h, --help show this help message and exit\n -o OUTFILE, --output OUTFILE\n filename for formatted HTML, stdout if omitted\n -s INDENT_WIDTH, --indent-width INDENT_WIDTH\n number of space for indentation, default 2\n -e ENCODING, --encoding ENCODING\n encoding of input, default UTF-8\n -t {html,js,css}, --filetype {html,js,css}\n type of file to parse, default \"html\"\n -v, --version show program's version number and exit\n\nExample\n*******\n\nPretty print HTML:\n\n.. code-block:: sh\n\n $ html5-print -s4 -\n Press Ctrl-D when finished\n
Some text for testing\n ^D\n \n
\n\n Some text for testing\n
\n \n \n $\n\nCreate valid HTML5 document from HTML fragment:\n\n.. code-block:: sh\n\n $ html5-print -s4 -\n Press Ctrl-D when finished\nHere is \"hello\" in different languages
\n\n Here is \"hello\" in different languages\n
\nSome text here
'\n >>> print(HTMLBeautifier.beautify(html, 4))\n \n \n\n Some Text\n
\n \n \n