Metadata-Version: 1.1
Name: htmlpyever
Version: 0.1.0.post2
Summary: Python bindings to html5ever
Home-page: https://github.com/tbodt/htmlpyever
Author: Theodore Dubois
Author-email: tblodt@icloud.com
License: LGPLv3
Description: htmlpyever
        ==========
        
        htmlpyever is a very single-minded binding to html5ever. You can:
        
        * Feed the parser:
        
          .. code-block:: python
        
            parser.feed(b'hOI wURLD!')
        
        * Get a callback when the parser encounters a closing script tag:
        
          .. code-block:: python
          
            def script_callback(script):
                # handle script
            parser = htmlpyever.Parser(script_callback)
        
            # or
        
            class MyParser(htmlpyever.Parser):
                def run_script(self, script)
                    # handle script
            parser = MyParser()
        
        * Obtain the result as an LXML ``Element`` or ``ElementTree``:
        
          .. code-block:: python
          
            from lxml import etree
            etree.tostring(parser.root)
            # >>> '<html><head/><body>hOI! wURLD!</body></html>'
            etree.tostring(parser.root)
            # >>> '<html><head/><body>hOI! wURLD!</body></html>'
            # not sure why the doctype doesn't show up in the serialized ElementTree
            
        That's it.
        
Keywords: html,html5,parser,parsing,html5ever
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
