Saravanan666/pypi-org huggingface dataset:
Package: htmlgen
Python HTML 5 GeneratorLibrary to generate HTML from classes.Basic usage:>>> from htmlgen import Division, Span
>>> Division("This is ", Span("important!"), "!")A more verbose example:>>> span = Span("important")
>>> span.add_css_classes("important")
>>> div = Division()
>>> div.id = "my-block"
>>> div.append("This is ")
>>> div.append(span)
>>> div.append("!")A tree constructed like this can be converted to a string:>>> str(div)
'<div id="my-block">This is <span class="important">important</span>!</div>'
>>> "<p>This is {}!</p>".format(span)
'<p>This is <span class="important">important</span>!</p>'Alternatively, all elements can be used as iterators, for example to return
them from a WSGI callback:>>> def application(env, start_response):
...     start_response("200 OK", [("Content-Type", "text/html")])
...     return divThere are two different ways to render children of HTML elements. The tree
construction approach shown above is mainly suitable for elements with few
children. The disadvantage of this approach is that the whole tree must be
constructed in memory. An alternative way, best suited for custom sub-classes
of elements, is to override the generate_children method of the Element class:>>> class MyBlock(Division):
...     def __init__(self):
...         super(MyBlock, self).__init__()
...         self.id = "my-block"
...     def generate_children(self):
...         yield "This is "
...         span = Span("important")
...         span.add_css_classes("important")
...         yield span
...         yield "!"
>>> str(MyBlock())
'<div id="my-block">This is <span class="important">important</span>!</div>'
Package: html-gen
Hgen PythonThis is a simple fun experimental project I wrote in python to write HTML tags
in python and render it as html.InstallationThis package is uploaded in pypi, so you can install it with pip.pipinstallhtml-genUsageUsing it is quite simple.importhtml_gen#or if you wanna import everythingfromhtml_genimport*DocumentationIn progress.ContributionEvery major / minor contribution is welcomed and highly appreciated.
Package: htmlgeng
htmlgenAs easy asgen=HtmlGenerator()withgen.rowasr:r(0).markdown("# Hello\n- List 1\n- *List 2*")r(0).latex(rf"\sum_i^n{__file__[10]}\left(i\right) = \mathbf(E)")r(0).markdown("That was an equation, like this one: $$x^2$$")r(1).image(rsc.img)Installpipinstallhtmlgen
pipinstall-e<path-to-repo>/htmlgen
pipinstallgit+ssh://git@github.com/GaetanDesrues/htmlgen.git
Package: htmlhelpers
This is a package which was inspired by the annoyance of writing html strings
when working with serving modules like flask.pipinstallhtmlhelpersBasic usageFirst, lets make some strings with basic html elements.fromhtmlhelpersimporthtmlstringashsCreate an html element:hs.p("We love volleyball!")# <p>We love volleyball!</p>or one with attributes:hs.p("We love volleyball!",attr_str='style="text-align:right"')# <p style="text-align:right">We love volleyball!</p>Or build a hierarchy:hs.html(hs.p("Still love volleyball!"))# <html><p>Still love volleyball!</p></html>Build a list:hs.ul("".join[hs.li("cats"),hs.li("dogs")])# <ul><li>cats</li><li>dogs</li></ul>Although once a list like that begins to grow, things can start to look a little messy. For more complex html expressions, we will be using the notion on atag_seriesand atag_phrase.fromhtmlhelpersimporthtmlphraseashpSay we have a rappidly growing list. We can use a series to quickly create many of the same html elements in succession. We can use atag_series.list_of_animals=["cats","dogs","rabbits"]animals=hp.tag_series(hs.li,list_of_animals)hs.ul(animals)# <ul><li>cats</li><li>dogs</li><li>rabits</li></ul>As the structure becomes deeper, we can further simplify our code with atag_phrase.hp.tag_phrase([hs.html,hs.div,hs.ul],animals)# <html><div><ul><li>cats</li><li>dogs</li><li>rabits</li></ul></div></html>Lastly, you can format the string in a much more human readable way, by setting theformatting=Truein thetag_seriesfunction.hp.tag_phrase([hs.html,hs.div,hs.ul],animals,formatting=True)"""
<html>
  <div>
    <ul>
      <li>cats</li>
      <li>dogs</li>
      <li>rabits</li>
    </ul>
  </div>
</html>
"""Optionally, you can pass one of these html phrase strings (any multilevel heirarchy) into theformat_phrasefunction, found inhtmlhelpers.htmlformatHope this helps at least a little! :)
Package: html-hyperframe
HyperFrameHyperFrame structures related information in an HTML document by searching for recurrent patterns in its element tree.An exampleInstall the package withpipinstallhtml-hyperframeYou can then extract hyperframes from an HTML document withimportrequestsfromhyperframeimportfind_and_create_hyperframesr=requests.get("https://wellhung.co.uk/")hyperframes=find_and_create_hyperframes(r.content)hyperframes[22]...(div,class)(div,0,a,href)(div,0,a,rel)(div,0,a,title)(div,0,a,0,text)(div,2,small,class)(div,2,small,0,text)(div,2,small,1,a,href)(div,2,small,1,a,0,text)0titlehttps://wellhung.co.uk/product/bombshell/bookmarkBombshellBombshellartistby/artists/cassandra-yapCassandraYap1titlehttps://wellhung.co.uk/product/great-vibes-gol...bookmarkGreatVibes–GoldChromeEditionGreatVibes–GoldChromeEditionartistby/artists/ben-riderBenRider2titlehttps://wellhung.co.uk/product/great-vibes-neo...bookmarkGreatVibes–NeonEditionGreatVibes–NeonEditionartistby/artists/ben-riderBenRider3titlehttps://wellhung.co.uk/product/cest-nes-pas-ba...bookmarkC’estN’esPasBananaC’estN’esPasBananaartistby/artists/luapLUAP4titlehttps://wellhung.co.uk/product/voyeur/bookmarkVoyeurVoyeurartistby/artists/cassandra-yapCassandraYap5titlehttps://wellhung.co.uk/product/i-fucking-love-...bookmarkIFuckingLoveYouIFuckingLoveYouartistby/artists/carrie-reichardtCarrieReichardt6titlehttps://wellhung.co.uk/product/dont-believe-ev...bookmarkDontBelieveEverythingyouThinkDontBelieveEverythingyouThinkartistby/artists/carrie-reichardtCarrieReichardt7title<https://wellhung.co.uk/product/be-kind/>bookmarkBeKindBeKindartistby/artists/carrie-reichardtCarrieReichardt
Package: html-image-embedder
html_image_embedderA Python package that embeds images into HTML documents using data URIs.InstallationYou can install html_image_embedder using pip:pip install html_image_embedderUsageTo use html_image_embedder, you need to import the embed_images function from the package:fromhtml_image_embedderimportembed_imagesThe embed_images function takes two arguments: html and images. The html argument is a string containing the HTML code. The images argument is a dictionary mapping image URLs to image bytes. For example, you can use the requests library to get the image bytes from a URL:importrequestsurl="https://example.com/image.png"response=requests.get(url)image_bytes=response.contentThe embed_images function returns a modified HTML string with the image data embedded in the src attributes of the img tags. For example:html="<html><body><img src='https://example.com/image.png'></body></html>"images={"https://example.com/image.png":image_bytes}new_html=embed_images(html,images)print(new_html)# <html><body><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."></body></html>LicenseThis project is licensed under the MIT License - see the LICENSE file for details.
Package: html-index
HTML IndexA python script that generates index.html files for file indexing.UsageSimply typeindex <path>.Replace the<path>with the path to the directory you want to generate indexes for.For example:index ./Optional Arguments-h, --help                  show this help message and exit

--title TITLE               change the title of the index.
                            (`#DIR`: the directory path)
                            (default: "Index of #DIR"

--parent_dir PARENT_DIR     change the name of the "parent directory"
                            button in the index.
                            (default: "parent directory")

--filename FILENAME         change the name of the field "File Name" in the table.
                            (default: "File Name")

--size SIZE                 change the name of the field "Size" in the table.
                            (default: "Size")

--modified MODIFIED         change the name of the field "Last Modified" in the table.
                            (default: "Last Modified")For example:index --title "檢索中: #DIR"
      --parent_dir "往上一層"
      --filename "檔案名稱"
      --size "大小"
      --modified "最後修改日期"
      ./NoteFiles started with.will be completely ignored.Files started with__will be processed, but will not show up inindex.html.Currently this is for wrapping.urlfiles while not showing them.For example:if I have aabc.url,it'll be wrapped into a.abcdirectory with aindex.htmlthat redirects you to whateverabc.urllinks toand it'll be shown asabcin the indexbut if I don't want to showabc.urlin the indexit should be renamed to__abc.urlso it'll still be looked at and wrapped, but not indexed.CustomizingUnderhtml-index/assets, there are several files.__file_template.htmlThis is the template for indexed files, edit it if you want to change how the indexed files look.__index_template.htmlThis is the template for theindex.html, edit it if you want to change how the whole index looks.__icons/Where all the icons are located.icons.ymlThe icon settings.Note that it's currently generated by a script and still needs configuration.
Package: html-index-maker
HTML Index MakerScrape local HTML files and generate an index.Usagepython-mhtml-index-maker-i./resources-f.html-o./data.jsonThis will call the module on the resources directory, look for html files and store the result in a given json file.Supported Reading FormatsHTMLORGSupported Writing FormatsJSONJSORGMARKDOWNChangelog0.1.3 Fixed .md output file, hyperlinks, headings.0.1.2 Fixed .org missing linebreak.s0.1.1 Added support for org, js, md, fixes.0.1.0 Initial Version
Package: htmlit
htmlgenAs easy asfromhtmlitimportHtmlGeneratorgen=HtmlGenerator()withgen.rowasr:r(0).markdown("# Hello\n- List 1\n- *List 2*")r(0).latex(rf"\sum_i^n{__file__[10]}\left(i\right) = \mathbf(E)")r(0).markdown("That was an equation, like this one: $$x^2$$")r(1).image(rsc.img)Installpipinstallhtmlit
pipinstall-e<path-to-repo>/htmlgen
pipinstallgit+ssh://git@github.com/GaetanDesrues/htmlgen.git
Package: htmlize
tiny utility command, generate html from any formats(e.g. .md, .rst)support formatmarkdownrestructured texthow to usetarget file(markdown)$catsample/hello.mdhello========================================hello## subsection*マルチバイト文字*multibytesstringoutput$htmlizesample/hello.md<!doctypehtml><html><head><metacharset="UTF-8"/></head><body><h1>hello</h1><p>hello</p><h2>subsection</h2><ul><li>マルチバイト文字</li><li>multibytesstring</li></ul></body></html>open by browser with -b optionwhen -b option is added, dump generated html to teporary file, and open via web browserhtmlize-b--themedefaultsample/hello.mdmemo(and thunks)css is borrowed from these repositories.https://github.com/jasonm23/markdown-css-themeshttps://gist.github.com/andyferra/25549190.2.1 support 2.7
0.2 css include
0.1 first release
Package: html-json-forms
html-json-formsAn implementation of theHTML JSON Formspecification for use with theDjango REST Framework.  Extracted fromwq.dbfor general use.HTML JSON Forms use an array-style naming convention that makes it possible to represent complex nested JSON objects with regular HTML fields.  The idea is that client applications (such aswq.app) and eventually browsers could parse these fields and submit structured JSON to the server.  For backwards compatibility with older clients, the spec recommends implementing a fallback parser on the server to ensure that older clients can submit forms using the traditional method.  This Python package is an implementation of that algorithm.<!-- Input --><form><inputname="items[0][name]"value="Example"><inputname="items[0][count]"value="5"></form>// Output{"items":[{"name":"Example","count":"5"}]}Note that the HTML JSON Form spec was never finalized.  The implementation is still useful as a formal way of representing structured data via traditional HTML forms.Usagehtml-json-formsis available via PyPI:pip3installhtml-json-formsFunctionalfromhtml_json_formsimportparse_json_formparse_json_form({'items[0][name]':"Example",'items[0][count]':"5",})DRF IntegrationTo enable HTML JSON Form parsing in Django REST Framework, subclassJSONFormSerializer:fromrest_frameworkimportserializersfromhtml_json_forms.serializersimportJSONFormSerializerfrom.modelsimportParent,ChildclassChildSerializer(serializers.ModelSerializer):classMeta:model=ChildclassParentSerializer(JSONFormSerializer,serializers.ModelSerializer):children=ChildSerializer(many=True)classMeta:model=Parent# Alternatively you can use the pre-mixed JSONFormModelSerializer:# class ParentSerializer(JSONFormModelSerializer):#    ...Note that only the top-level serializer needs to have theJSONFormSerializermixin; the nested serializers will "just work" as if the data had been submitted via JSON.  Note further that this module only handles processing nested form data; it is still up to you to figure out how to handlewriting nested models(unless you are usingwq.db'spatternsmodule, which includes writable nested serializers by default).
Package: html_jumping
Welcome to HTML-JumpingAuthor:Daniel Perez Rada <@dperezrada>What?Allows to get an HTML, coming from several previous URLs. Sometimes this is needed to get webpages that requires cookies or a HTTP referrer to get a certain page.Pre-requisitesYou will need:httplib2http://socksipy.sourceforge.net/(if you want to use a proxy)To run the test you will also need:lxmlExampleNo proxyfrom html_jumping import HtmlJumping
handler = HtmlJumping()
urls = [
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET'
    },
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET',
        'body': {
            'term': 'html_jumping',
            ':action': 'search',
            'submit': 'search'
        }
    }
]
received_header, received_content = handler.get(urls)With proxyAllow you to use a HTTP proxy, you will need to install the socksipy library.from html_jumping import HtmlJumping
handler = HtmlJumping()
urls = [
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET'
    },
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET',
        'body': {
            'term': 'html_jumping',
            ':action': 'search',
            'submit': 'search'
        }
    }
]
received_header, received_content = handler.get(
    urls,
    proxy_info = {'host': '127.0.0.1', 'port': '8081'}
)With permanent headersThis will sent in each call the headers ‘Accept-Language’.from html_jumping import HtmlJumping
handler = HtmlJumping()
urls = [
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET'
    },
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET',
        'body': {
            'term': 'html_jumping',
            ':action': 'search',
            'submit': 'search'
        }
    }
]
received_header, received_content = handler.get(
    urls,
    permanent_headers = {'Accept-Language': 'es, en-cl;q=0.5'}
)TestsRun>> nosetests
Package: html_librarian
# LibrarianThe goal of this package is to almost be like a training wheels setup for web scraping.A good example is recursively trying to visit all of the links on a site such as:http://web.archive.org/web/20080827084856/http://www.nanowerk.com:80/nanotechnology/nanomaterial/commercial_all.php?page=2If you mess up your scrape and you have done no preemptive measures, you lose all of your work done thus far. What `Librarian` aims to do is to save that html for later, so you don't have to redo scrapes that you have done before, letting you be much nicer to where you're requesting to and saving you time, letting you go through a much smoother scraping experience.Let's outline an example:Take a look at the site above's html via Inspect Element; You will see that all of the names and links are under <div class="divhead">, and all of the blurbs are under <div class="divline">. Now, I would probably do this:```python3from urllib.request import urlopenfrom bs4 import BeautifulSoupalink = 'http://web.archive.org/web/20080827084856/http://www.nanowerk.com:80/nanotechnology/nanomaterial/commercial_all.php?page=2'resp = urlopen(alink)html = resp.read()soup = BeautifulSoup(html, 'lxml')for elem in soup.select('div.divhead'):print(elem.get_text())```To check if I was correct and there was nothing above that had the same css selector, to see if I had to change my headers using urllib.request.Request, or something else.Then I'd probably check the same for `div.divline`, for the first reason above. Then for each of those sites, I'd have to recursively visit into them and grab their html.If I screw anything up, or if some pages have different html, then it will take a long time to get back to where I was, making the process of scraping a site more painful than it has to be.If we use `Librarian`, we can instead do this:```python3from librarian import Librarianlib = Librarian()alink = 'http://web.archive.org/web/20080827084856/http://www.nanowerk.com:80/nanotechnology/nanomaterial/commercial_all.php?page=2'html = lib.get(alink)soup = BeautifulSoup(html, 'lxml')```Now, if I ever ask for that same website again (provided that `htmlLibrary` and the pickled files under `libarianTools` haven't been tampered with), the `Librarian` will find it and pull it out of your `htmlLibrary` so you can instantly use it.If you need updated html, just```python3from librarian import Librarianalink = 'http://web.archive.org/web/20080827084856/http://www.nanowerk.com:80/nanotechnology/nanomaterial/commercial_all.php?page=2'removed = lib.remove(alink)assert removed````lib.remove(alink)` will remove the link `alink` from your `htmlLibrary` and `linkMap`, so if you ever call `lib.get(alink)` with the same link, the `Librarian` will get the html once again.This project is in it's infancy so if you want any features created, create an issue and I will get on it.Thank you to `keithreitz` for creating `samplemod`, which I largely copied for the project structure.
Package: html-linter
HTML LinterHTML Linter is an HTML5 linter that follows the style guide defined by Google.MotivationHandling HTML5 files generated by lots of different of people is a difficult
task, because the standard is evolving quite fast and also because browsers are
quite open to accept any malformed/invalid/incomplete input.That’s why we decided to have an automated tool to check our coding standard.We start with theGoogle standardand we enhance it with some extra rules defined by the projecthtml-minifier. You can read his
detailedarticle.The list of extra rules we added are:Boolean attributes should not have an explicit value.Do not use the name attribute in a tags.Do not use the language attribute in script tags.Do not use the charset attribute in script tags when there is no source.Javascript:void(0) links are evil.onclick=’javascript: …’ is not required. This will raise also a Concerns Separation error.meta http-equiv: use only standard properties + X-UA-compatibleNo extra white-spaces between attributes or before the opening or closing tag.What is missing?Check if the file has BOM.The ability to validate the HTML using the toolHTML5 tidyand to integrate some
schema.org or microdata validator.However, we do not have any short terms plans to handle the latter, due to a
couple of reasons:Tidy can be easily integrated using the toolgit-lintAny other validator can also be integrated withgit-lintAdding any extra validator would pull many more dependencies and change the scope.Limitationshtml_linter used the projecttemplate-removerto remove the
PHP and Jinja markup from the files and this project works has some limitations.One example that won’t work is the following:<?php echo "?>" ?>The reason it does not work is because when the method sees the first ‘?>’
(the one inside the string), it thinks it’s a closing tag.Example useBelow are example of how template_remover.py is used:$ html_lint.py filename.htmlInstallationYou can install, upgrade or uninstall html-linter with these commands:$ pip install html-linter
$ pip install --upgrade html-linter
$ pip uninstall html-linterPython VersionsPython 2.7, 3.3, 3.4, 3.5 and 3.6 are supported.DevelopmentHelp for this project is more than welcomed, so feel free to create an issue or
to send a pull request viahttp://github.com/deezer/html-linter.Tests are run using nose, either with:$ python -R setup.py nosetests
$ nosetestsUse the toolgit-lintbefore any commit, so
errors and style problems are caught early.TODOS and Possible FeaturesMake the output less verbose.Integrate with HTML5 tidy.Integrate with a schema.org/microdata validator.ContributorsDustin IngramChangelogv0.4 (2017-03-30)Support for a--printfilenameoption (#8)Support for Python 3.6 (#12)v0.3 (2016-01-24)Support for multiple files (by@di)v0.2 (2015-12-13)Support for Python 3.5v0.1 (2014-05-07)Initial commit.
Package: htmllistparse
Python parser for Apache/nginx-style HTML directory listingimporthtmllistparsecwd,listing=htmllistparse.fetch_listing(some_url,timeout=30)# or you can get the url and make a BeautifulSoup yourself, then use# cwd, listing = htmllistparse.parse(soup)wherecwdis the current directory,listingis a list ofFileEntrynamed tuples:name: File name,str. Have a trailing / if it’s a directory.modified: Last modification time,time.struct_timeorNone. Timezone is not known.size: File size,intorNone. May be estimated from the prefix, such as “K”, “M”.description: File description, file type, or any other things found.stras HTML, orNone.Supports:Vanilla Apache/nginx/lighttpd/darkhttpd autoindexMost<pre>-style indexMany other<table>-style index<ul>-styleNotePlease wrap the functions in a generaltry...exceptblock. It may throw exceptions unexpectedly.ReHTTPFSReinvented HTTP Filesystem.Mounts most HTTP file listings with FUSE.Gets directory tree and file stats with less overhead.Supports Range requests.Supports Keep-Alive.usage: rehttpfs.py [-h] [-o OPTIONS] [-t TIMEOUT] [-u USER_AGENT] [-v] [-d]
                   url mountpoint

Mount HTML directory listings.

positional arguments:
  url                   URL to mount
  mountpoint            filesystem mount point

optional arguments:
  -h, --help            show this help message and exit
  -o OPTIONS            comma separated FUSE options
  -t TIMEOUT, --timeout TIMEOUT
                        HTTP request timeout
  -u USER_AGENT, --user-agent USER_AGENT
                        HTTP User-Agent
  -v, --verbose         enable debug logging
  -d, --daemon          run in background
Package: html-loader
html_loaderLoaderHTMLArguments: name: str="Document" — Window's name, icon: str | None=None — Window's icon, width: int=700, heigth: int=700Functions:Thread(fun) — start function from thread (decorator)load_html(code: str) — load codeload_from_url(url: str) — load code from urlload_file(name: str) — load code from fileload_file_absolute_path(name: str) — load code from file by absolute pathrun() — show windowExample:fromhtml_loaderimportLoaderHTMLloader=LoaderHTML("Test","icon.png")loader.load_file("index.html")# this function will start and run until it ends without affecting the window@load.Threaddefmain():url=input("url:")loader.load_from_url(url)loader.run()
Package: htmlmaker
htmlmakerInstallationpip3 install htmlmakerUsagefrom htmlmaker import htmlmaker as hmfp=open('pure-min.css','r',encoding='utf-8')css=fp.read()test_table1={"title":"my_good_table1","headers":["x","y","z"],"body":[{"x":"Title x","y":"Title y","z":"Title z"},{"x":1,"y":make_anchor("https://www.google.com","google",True),"z":3},{"x":2,"y":3,"z":4}]}test_table2={"title":"my_good_table2","headers":["x","y","z"],"body":[{"x":"Title x","y":"Title y","z":"Title z"},{"x":1,"y":make_anchor("https://www.google.com","google",True),"z":3},{"x":2,"y":3,"z":4}]}data={"tables":[test_table1,test_table2]}hm.make_output_html('test.html',data,css)Functionsmake_anchor()Params: url, content, _blankdef make_output_html()Params: output_path, data, css