You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. """
  2. HTML parsing library based on the `WHATWG HTML specification
  3. <https://whatwg.org/html>`_. The parser is designed to be compatible with
  4. existing HTML found in the wild and implements well-defined error recovery that
  5. is largely compatible with modern desktop web browsers.
  6. Example usage::
  7. from pip._vendor import html5lib
  8. with open("my_document.html", "rb") as f:
  9. tree = html5lib.parse(f)
  10. For convenience, this module re-exports the following names:
  11. * :func:`~.html5parser.parse`
  12. * :func:`~.html5parser.parseFragment`
  13. * :class:`~.html5parser.HTMLParser`
  14. * :func:`~.treebuilders.getTreeBuilder`
  15. * :func:`~.treewalkers.getTreeWalker`
  16. * :func:`~.serializer.serialize`
  17. """
  18. from __future__ import absolute_import, division, unicode_literals
  19. from .html5parser import HTMLParser, parse, parseFragment
  20. from .treebuilders import getTreeBuilder
  21. from .treewalkers import getTreeWalker
  22. from .serializer import serialize
  23. __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder",
  24. "getTreeWalker", "serialize"]
  25. # this has to be at the top level, see how setup.py parses this
  26. #: Distribution version number.
  27. __version__ = "1.0.1"