Saravanan666/pypi-org huggingface dataset:
Package: html-matcher
HTML MatcherThe pypi package in Python contains a series of functions for calculating the similarity ratio between pages in websites
or web applications.How to INSTALL?pip install html-matcherHow to USE?By comparing the HTML structure, style, or both, the similarity ratio can be computed. Two techniques are available for
structure comparison: Matching Subsequences (MS) and All Path Tree Edit Distance (APTED). One algorithm that uses the
jaccard similarity metric is offered for style comparison.StructureMSExamplems = MatchingSubsequences()
ratio = ms.similarity(page1,page2)or you can use our improved method of MS that provides better resultsms = MatchingSubsequencesOptimized()
ratio = ms.similarity(page1,page2)APTEDExampleapted = AllPathTreeEditDistance()
ratio = apted.similarity(page1,page2)or you can use our improved method of APTED that reduces computational timeapted = AllPathTreeEditDistanceOptimized()
ratio = apted.similarity(page1,page2)StyleEach html document's css classes are extracted, and thejaccard similarityof the sets of classes is calculated.Jaccard SimilarityJ(A,B) = |A ∩ B| / |A U B|Examplestyle = StyleSimilarity()
ratio = style.similarity(page1,page2)Structure & StyleWe must pass a weight for each metric when combining similarity measures (k). The default value is 0.5, but in our
experiments, we found that, when comparing web pages based on their similarity ratio, structure takes precedence over
style, so 0.7 produces better results.k * similarity(page_1, page_2) + (1 - k) * similarity(page_1, page_2)Examplestyle = StyleSimilarity()
apted = AllPathTreeEditDistanceOptimized()
method = MixedSimilarity(apted, style, k=0.7)
ratio = method.similarity(page1,page2)
Package: htmlmerger
StatusCompatibilitiesContactHtmlMergerA package allowing to merge all html files in a directory in a single file.Installationgit clone https://github.com/pcotteadvestis/htmlmerger
cd htmlmerger
python setup.py installorpip install htmlmergerUsageMerges html files into a fingle fileFor each file, will extract the content between the  ... <\head><\body><\html> or... <\\body><\\html> and put all those contents between those same tags in a new file. Simple as
that.You can either give a list of files or a directory as input, and if not specified the output will be
input_directory/merged.html, or ./merged.html. You can also pass the argument "clean=True" when calling merge() to
delete the
individual files
used for merging.Supports transparentpath objects.fromhtmlmergerimportHtmlMergermerger=HtmlMerger(input_directory="my_htmls/")# result will be in my_htmls/merged.htmlmerger.merge(clean=True)# or clean=False to keep the individual files (default behavior)frompathlibimportPathmerger=HtmlMerger(files=Path("my_htmls/").glob("*"))# result will be in ./merged.htmlmerger.merge()
Package: htmlmetadata
HTMLmetadataExtract metadata from html pages using Open Graph metadata, HTML metadata, and a series of fallbacksInspired inhttps://metascraper.js.orgInstallpipinstallhtmlmetadataUseYou can use it by calling the module directly.python -m htmlmetadata http://schema.org/docs/about.html                                                                            
{
  "request": {
    "url": "http://schema.org/docs/about.html"
  },
  "summary": {
    "description": "Schema.org is a set of extensible schemas that enables webmasters to embed\n    structured data on their web pages for use by search engines and other applications.",
    "title": "about page - schema.org",
    "language": "en"
  }
}Or use it directly in your code.fromhtmlmetadataimportextract_metadatadata=extract_metadata("http://schema.org/docs/about.html")
Package: htmlmeta-hub
htmlmeta_hubBuild Status:htmlmeta_huboffers lightweight support for managing metadata on webpages.This package simply and conveniently manages a dict of "metadata"", and renders
it appropriately.There are helpers for the Pyramid framework which will attach the metdata object
to a request, allowing you to build up metadata throughtout the request cycle
and then finally render.A typical way to use this package in the Pyramid framework:Include this package in your application's__init__.py:def main(global_config, **settings):
	...
	# custom htmlmeta
	config.include("htmlmeta_hub.pyramid_helpers")If you are using "class based views", you can set some default metadata in a core
handler:class Handler(object):
	def __init__(self,request):
		self.request = request
		# set some defaults
		self.reqesut.htmlmeta.set_many(\
			title="MyApp",
			description="awesome",
			keywords="fun!",
		)and then you can add specific metadata in each view's handler:class ContentPage(Handler):
	def view(self):
	    content= ...
		self.request.htmlmeta.set('title', content.title)
		self.request.htmlmeta.set('description', content.description)In a template, such as thispage.makoexample, you can access specific bits of
the metadata, or render an entire payload:<title>${request.htmlmeta.get('title')|n}</title>
${request.htmlmeta.as_html()|n}Pyramid helpers existed until version0.3.xbut were dropped in favor of the@reifyrequest method offered by theconfig.includemethod.Pylons helpers existed until version0.1.2but were dropped.
Package: html-mitra
Developed by Dev Gautam KumarRequirementsUsageYou can use this library to create an HTML file if you are new to HTMLImport|from html-mitra import html |Create HTML file with preformatted headershtml.create_html(file_name)Create HTML elementshtml.create_element(element_name,inner_content)Append elements and contentshtml.append(file_name,content)Overwrite a filehtml.overwrite(file_name,content)Delete a filehtml.delete(file_name)Complete and serve the filehtml.finish(file_name)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: html-msg
What is it?html_msgis a Python package that provides functionality to build up HTML messages via simple methods, without the need to write HTML code manually.Main FeaturesHere are a few of the things thathtml_msgdoes well:Easy adding of plain text into messageCreation of tables and adding them into messageEasy formating of text and tables via CSS propertiesRendering and displaying of HTML message in IPython notebookWhere to get it# PyPI
pip install html-msgDocumentationGetting startedImport main classes from the package.from html_msg import HTMLMessage, HTMLTableMessage creationNow let's create a message and add there some text.# Create an instance of HTMLMessage
message = HTMLMessage()

# add line of text into message
message.insert_text('Hello, Dears!')

# add another line of text, but on new line this time
message.insert_text('Here are the latest news...', new_line=True)

# in order to add an empty line, pass an empty string to the method 'insert_text'
message.insert_text('', new_line=True)

# and let's add another line of text, but this time it should be bold
bold_text_style = {'font-weight':'bold'}
message.insert_text('Must be this line of text is important!', 
                    new_line=True, 
                    style_dict=bold_text_style)In order to see, what we created, use the method 'display'.
Please note, that this method uses IPython functionality.message.display()The result should look like this:Hello, Dears!Here are the latest news...Must be this line of text is important!Table creationLet's create a table and fill it with some data# create list that contains table headers
table_headers = ['Item', 'Price', 'quantity']

# rows are represented as list of lists. Every list is a row. 
initial_rows = [ 
    ['Apple', 10, 245], 
    ['Orange', 25, 199] 
]

# create an instance of HTMLTable, pass arguments that were defined above
table = HTMLTable(rows=initial_rows, headers=table_headers)We can add rows whenever we want to:# in order to add a row to the table, use method 'add_row'
table.add_row(['Pear', 19, 387])Or change headers, if necessary:table.set_headers(['Goods', 'Net price', 'Amount'])There are several design presets that you can apply to the table, in order to see them, use method 'show_table_design_presets'table.show_table_design_presets()By default, preset 'Basic' is used, but you can apply any design you like better via the method 'apply_design_preset'table.apply_design_preset('Grey')In order to insert the table into the message, you first need to transform the table into HTML codeand then insert this HTML into the message body.# transforming table into html code, which is contained in string format
table_html = table.to_string()

# inserting table into message body
message.insert_html(table_html)Transformation to HTML codeNow, we can transform this message to HTML code in order to send it.Please note that this library does not provide functionality to send messages.One should use other libraries for that.# the method 'to_string' returns HTML code in string formart. 
# One can pass it to abstract email sender, which will send it to the recepient.
html_code = message.to_string()
Package: htmlobj
htmlobjhtmlobjallows you to easily create complex HTML (or XML, xHTML) using nothing but Python code.  It is an alternative to using templates in web frameworks, which usually have their own language syntax.Example:fromhtmlobjimportHTMLh=HTML("html")h.head.title("My Page")# can chain tags if only 1 subitemwithh.body:# use `with` for multiple subitemsh.p.u("Paragraph 1 underlined")withh.p("Paragraph 2 ",class_="p2"):# add attributes tooh.b("bold")h.text(", not bold")# add additional textprint(h)Which outputs:<html><head><title>My Page</title></head><body><p><u>Paragraph 1 underlined</u></p><pclass="p2">Paragraph 2<b>bold</b>, not bold</p></body></html>Note that theclass_attribute has a trailing underscore becauseclassis a Python keyword.New Featureshtmlobjis a re-packaging ofhtml3,  with further Python 3 modernization and additional functionality added.One added feature is creating anhtmlobj.HTMLinstance from existing html, either as a string (HTML.from_html), or from a url (HTML.from_url):h=HTML.from_url("https://example.com/")This will often be used in combination with another new feature,HTML.codify, togenerate Python codeusinghtmlobj, for you.  Start with a page that is similar to what you want to create, then modify as needed, e.g. to programatically fill in data for that page.print(h.codify())which gives output like:h = HTML()
with h.html:
    with h.head:
        h.title("Example Domain")
        h.meta(charset="utf-8")
        h.meta(http-equiv="Content-type", content="text/html; charset=utf-8")
...You can then copy this output as a starting point for you own code, to make a webpage similar to the one passed tofrom_url.Note:  you can also achieve afrom_url/codifycombination from the command line by runninghtmlobj.html_parserwithpython -m:python -m htmlobj.html_parser https://example.com > my_code.pyInstallationpip install htmlobjNext StepsSeeGetting Startedfor more examples and detailed usage information.
Package: htmloverpdf
Render a HTML overlay over existing PDF files.Installsudo apt install libgirepository1.0-dev gir1.2-poppler-0.18 gir1.2-pango-1.0
python3 -m pip install htmloverpdfA wrapper forhttps://weasyprint.org/which allows compositing with existing PDF files.It parses the HTML looking for <img> tags with src urls ending “.pdf”. Each one begins a new page and copies all source pages overlaying the weasyprint output.
The magic value “blank.pdf” outputs sections HTML without overlaying.Usagehtmloverpdf < test.html > test.pdf
Package: htmlpack
htmlpackThe htmlpack module can be used to help preprocess HTML files for production environments. It can be used to strip HTML comments, minify HTML,
and more.usage: python -m htmlpack [-h] [-s] [-v] [-d] path

positional arguments:
  path                  Path to file or folder

optional arguments:
  -h, --help            show this help message and exit
  -s, --strip-comments  Whether to strip HTML comments (default: False)
  -v, --verbose         Verbose output (default: False)
  -d, --dry-run         Perform a dry run without modifying files (default: False)
Package: html-parse
表格解析工具提供html表格解析功能，可以根据表格行查找元素内容，返回表格行列表安装pip install html-parser
or
pip install git+https://github.com/lvyunze/html_parse.git单个表格行数据获取import urllib.request
from table_parser import HtmlTableParser


def url_get_contents(url):
    """ Opens a website and read its binary contents (HTTP Response Body) """
    req = urllib.request.Request(url=url)
    f = urllib.request.urlopen(req)
    return f.read()


def main():
    url = 'http://www.stats.gov.cn/tjsj/zxfb/202105/t20210517_1817510.html'
    xhtml = url_get_contents(url).decode('utf-8')
    p = HtmlTableParser()
    p.feed(xhtml)
    print(p.seach_item("采矿"))
    # ['采矿业', '…', '3.2', '…', '8.4']
    # 多行数据获取
    item_list = ["采矿业", "制造业", "产品销售率"]
    item_data = [p.seach_item(data) for data in item_list]
    """
    [['采矿业', '…', '3.2', '…', '8.4'], ['制造业', '…', '10.3', '…', '22.2'], 
    ['产品销售率（%）', '98.3', '0.4 ( 百分点 )', '97.9', '0.9 ( 百分点 )']]
    """
Package: htmlparsingbs4based
# HTML Parserextracts/parses information from source HTML.# construct a Pypi packagepython3 setup.py sdist bdist_wheeltwine upload dist/*# create CLI from dist (if you has .dist file)python3 -m pip install /home/yaxiong/html_parsing/dist/htmlparsingbs4based-1.1.0.tar.gz# install package and CLIpip install htmlparsingbs4basedOR python3 -m pip install htmlparsingbs4based# run from scriptfrom htmlparsingbs4based.html_parsing.html_parser_custombs4_script import parse_single_pageparse_single_page(input_url=’https://bryansfuel.on.ca/about/’,  path_to_crawled_files=’/home/yaxiong/data_crawled_websites/crawled_websites_first_batch’, min_length=1,  prefix=””)# run CLI (examples)mode_1: eleasticsearchPARSE -gpf elasticsearch -i ‘http://www.mineracamargo.com/MCA_Investors.html’ -esusr readwrite -espw ‘’mode_2: localPARSE -gpf local -i ‘https://bryansfuel.on.ca/about/’ -fo /home/yaxiong/data_crawled_websites/crawled_websites_first_batchPARSE -gpf local -i ‘http://www.mineracamargo.com/MCA_Investors.html’ -fo /home/yaxiong/data_crawled_websites/crawled_websites_first_batchPARSE -gpf local -i ‘https://www.conpak.com/About-Conpak/’ -fo /home/yaxiong/data_crawled_websites/crawled_websites_first_batchmode_3: htmlPARSE -gpf html -fi /home/yaxiong/html_parsing/html_example/parsed_html.json
Package: html-plot
This package can be used to render Matplotlib plots as HTML objects in
Jupyter, so that they can be placed in HTML tables, downloaded on click,
and more.Installationpipinstallhtml_plotExamplesimportpandasaspdmy_plot=pd.DataFrame([[1,2,3],[4,5,6]]).plot()Simple usagehtml_plot.display(my_plot)Advanced usageAdjust Figure and Axes (e.g. figsize, title)plot_dim=html_plot.get_dim(my_plot.get_figure())plot_dim.figsize*=1.5ax=html_plot.ax("This is my plot",**plot_dim)my_html_plot=pd.DataFrame([[1,2,3],[4,5,6]]).plot(ax=ax)Output HTML stringhtml_str=html_plot.html_str(my_html_plot)print(html_str)Output anIPython.display.HTMLobjectimportIPython.displayhtml_obj=html_plot.HTML(my_html_plot)IPython.display.display(html_obj)Display the object using a wrapper forIPython.display.display()html_plot.display(my_html_plot)LicenceThis work is dual-licensed under theOpen Software License 3.0and theAffero GNU General Public License 3.0.
You can choose one of them if you use this work.SPDX-License-Identifier: OSL-3.0 OR AGPL-3.0-or-laterThe primary, more permissive licence is OSL-3.0, which allows the package to
be used in any software project, regardless of the project's licence (open or
closed source, commercial or non-commercial).If you distribute software that uses a modified version of this package, the
licence requires you to releaseonly the code of the modified package,
not the whole software project.You are very welcome to do the above in the form of pull requests.In other words, it's a reasonable, LGPL-like weak copyleft that doesn't try
to infect all your software with a particular licence.See theexplanation and rationale for OSL-3.0written by the author of the licence.The alternative licence is AGPL-3.0, which allows the package to be combined
with GPL-3.0 code.Under both OSL-3.0 and AGPL-3.0, the aforementioned weak copyleft is also
triggered by using the software over a network. In today's age of web apps,
it makes no sense to have different terms depending on the technical details
of how the software interacts with the user (locally or over a network). It's
surprising how few open-source licences have caught up with the times.
Package: htmlPy
<h1>htmlPy</h1><h4>HTML5-CSS3-Javascript based GUI library in Python</h4><a href="https://travis-ci.org/amol-mandhane/htmlPy" class="badges" target="_blank"><img src="https://img.shields.io/travis/amol-mandhane/htmlPy/master.svg"></a><a href="https://pypi.python.org/pypi/htmlPy/" class="badges" target="_blank"><img style="max-width:100%;" src="https://img.shields.io/pypi/v/htmlPy.svg"></a><a href="https://pypi.python.org/pypi/htmlPy/" class="badges" target="_blank"><img style="max-width:100%;" src="https://img.shields.io/pypi/dm/htmlPy.svg"></a><br><br><p>htmlPy is a wrapper around <a href="https://pyside.org/" target="_blank">PySide</a>'s QtWebKit library. It helps with creating beautiful GUIs using <b>HTML5, CSS3 and Javascript</b> for standalone Python applications. It is built on <a href="http://qt.io/" target="_blank">Qt</a> which makes it highly <b>customizable and cross-platform</b>. htmlPy is compatible with both <b>Python2 and Python3</b>. It can be used with any python library or environment like <a href="https://www.djangoproject.com/" target="_blank">django</a>, <a href="http://flask.pocoo.org/" target="_blank">flask</a>, <a href="http://www.scipy.org/" target="_blank">scipy</a>, <a href="http://virtualenv.readthedocs.org/" target="_blank">virtualenv</a> etc. You can use front-end libraries and frameworks like <a href="http://getbootstrap.com/" target="_blank">bootstrap</a>, <a href="http://jquery.com/" target="_blank">jQuery</a>, <a href="http://jqueryui.com/" target="_blank">jQuery UI</a> etc. and create GUIs for your applications in no time.</p><h2>Documentation</h2><p>The documentation is hosted at <a href="http://htmlpy.readthedocs.org/">http://htmlpy.readthedocs.org/</a>. It contains <b>installation instructions, tutorials, reference guide</b>, compatibility details, and more.</p><h2>Example</h2><table style="width: 150%; margin-left: -25%;"><tr><td><h3>Back-end <br> <small class="typewriter">back_end.py</small></h3><pre><code class="language-python">import htmlPyfrom main import appclass BackEnd(htmlPy.Object):@htmlPy.Slot()def say_hello_world():app.html = u"Hello, world"</code></pre></td><td><h3>GUI <br> <small class="typewriter">main.py</small></h3><pre><code class="language-python">import htmlPyfrom back_end import BackEndapp = htmlPy.AppGUI(title=u"Sample application")app.maximized = Trueapp.bind(BackEnd())app.template = ("index.html", {})if __name__ == "__main__":app.start()</code></pre></td><td><h3>Front-end <br> <small class="typewriter">index.html</small></h3><pre><code class="language-markup highlight">&lt;html&gt;&lt;body&gt;&lt;ahref="BackEnd.say_hello_world"data-bind="true"&gt;Click to say "Hello, world"&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;</code></pre></td></tr></table><h2>Code</h2><p>htmlPy source code is hosted on <a href="https://github.com/amol-mandhane/htmlPy" target="_blank">GitHub</a>, tested on <a href="https://travis-ci.org/amol-mandhane/htmlPy" target="_blank">Travis CI</a> and released on <a href="https://pypi.python.org/pypi/htmlPy/" target="_blank">PyPI</a>.</p></div>
Package: htmlpyever
htmlpyever is a very single-minded binding to html5ever. You can:Feed the parser:parser.feed(b'hOI wURLD!')Get a callback when the parser encounters a closing script tag:defscript_callback(script):# handle scriptparser=htmlpyever.Parser(script_callback)# orclassMyParser(htmlpyever.Parser):defrun_script(self,script)# handle scriptparser=MyParser()Obtain the result as an LXMLElementorElementTree:fromlxmlimportetreeetree.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 ElementTreeThat’s it.
Package: html-reporter
html-reporterATestRunnerfor use with the Python unit testing framework. It generates a report in an HTML file to show the results
at a glance. This package was inspired byHTMLTestRunner.pywritten byWai Yip Tungand began with transforming the old code to useJinja2template and adopting Bootstrap 5 CSS.Getting startedPrerequisiteshtml-reporterrequires Python 3.7 or later.InstallInstall the package via pip:$pipinstallhtml-reporterUsageHTMLTestRunneris a counterpart tounittest.TextTestRunner. Instantiate anHTMLTestRunnerobject and use it to run
your test suite.Example usingunittest.main:importunittestfromhtml_reporterimportHTMLTestRunner# output to a fileif__name__=="main":runner=HTMLTestRunner(report_filepath="my_report.html",title="My unit test",description="This demonstrates the report output by HTMLTestRunner.",open_in_browser=True)# run the testunittest.main(testRunner=runner)Example usingunittest.TestSuite:importunittestfromhtml_reporterimportHTMLTestRunner# output to a fileif__name__=="main":my_test_suite=unittest.TestSuite()# define your test suite# add your test cases:# my_test_suite.addTest(...)runner=HTMLTestRunner(report_filepath="my_report.html",title="My unit test",description="This demonstrates the report output by HTMLTestRunner.",open_in_browser=True)# run the testrunner.run(my_test_suite)Free software: MIT licenseDocumentation:https://html-reporter.readthedocs.io.FeaturesTODO[x] Switch to Jinja2 template[x] Refactor[x] Add support for skipped tests[x] Release pypi package[ ] Option for combine/separate report files[ ] Add tests[ ] Improve documentationsCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.This package was inspired byHTMLTestRunner.pywritten byWai Yip Tung.History0.2.6 (2022-05-13)First tested release on pypi.Support and tested with Python3.7 -> Python 3.9.
Package: html-report-generator
numerous Report GeneratorA python package focused on enabling you to create beautiful and powerful html reports with great ease. You can use the reports to document your work and showcase your data, even generating these automitically with your analysis code already implemented in python.This package exposes a simple library to create a report, adding your sections, figures and tables or even just directly html divs with your own custom html code.When you have added your content to the report you can save it to a stand-alone html file you can share with anyone.We have provided you with a first template that you can modify to your needs. Soon we will publish a guide on how to change basic things in it - for instance the logo file.InstallationThe package numerous report generator can be installed with:pip install numerous-report-generatorQuick startHere is a simple example to get you started once you have installed the package:frompathlibimportPathimportosfromnumerous.html_report_generatorimportReport,Section,GoFigure,DataFrameTableimportpandasaspd# Define output folder and html filefolder=Path('./output')filename='my_first_report'file=folder.joinpath(filename+'.html')#Remove previous report file if existsifos.path.exists(file):os.remove(file)# Create reportreport=Report(target_folder=folder,filename=filename)# Add info for the header and title pagereport.add_header_info(header='My Organization',title='My First Report',sub_title='but not the last',sub_sub_title='at all',footer_title='My first footer',footer_content='This is the end!')#Add a sectionsection=Section(section_title="Section 1")#create a figurefigure=GoFigure({"data":[{"type":"bar","x":[1,2,3],"y":[1,3,2]}],"layout":{"title":{"text":"A Figure Specified By Python Dictionary"}}},caption="Test figure",notes=["Please notice x","Please notice y"])#create a tabletable=DataFrameTable(pd.DataFrame({'a':[1,2,3],'b':[4,5,6]}),caption="This is a test table")#Add the figure and table to the sectionsection.add_content({'figure':figure,'table':table})#Add the section to the reportreport.add_blocks({'section':section})# Save the report - creates the html output filereport.save()Contributing:Please see CONTRIBUTING.md for details on how to contribute.