Saravanan666/pypi-org huggingface dataset:
Package: pyhrp
pyhrpA recursive implementation of the Hierarchical Risk Parity (hrp) approach by Marcos Lopez de Prado.
We take heavily advantage of the scipy.cluster.hierarchy package.Here's a simple exampleimportpandasaspdfrompyhrp.hrpimportdist,linkage,tree,_hrpprices=pd.read_csv("test/resources/stock_prices.csv",index_col=0,parse_dates=True)returns=prices.pct_change().dropna(axis=0,how="all")cov,cor=returns.cov(),returns.corr()links=linkage(dist(cor.values),method='ward')node=tree(links)rootcluster=_hrp(node,cov)ax=dendrogram(links,orientation="left")ax.get_figure().savefig("dendrogram.png")For your convenience you can bypass the construction of the covariance and correlation matrix, the links and the node, e.g. the root of the tree (dendrogram).importpandasaspdfrompyhrp.hrpimporthrpprices=pd.read_csv("test/resources/stock_prices.csv",index_col=0,parse_dates=True)root=hrp(prices=prices)You may expect a weight series here but instead thehrpfunction returns aClusterobject. TheClustersimplifies all further post-analysis.print(cluster.weights)print(cluster.variance)# You can drill into the graph by going downstreamprint(cluster.left)print(cluster.right)Installation:pip install pyhpr
Package: pyhrtc
pyhrtcpyhrtc is a Python module to inspect various types of stable matching problems. In particular, it can handle the Hospital-Residents problem with both Ties and Couples, also known as HRTC. Having no couples reduces this to the Hospital-Residents problem with Ties, HRT, and by letting all hospitals have capacity 1 we get the Stable Marriage with Ties and Incomplete Lists problem, SMTI.FeaturesThis package can currentlyread instance files in multiple formats,write instance files,inspect agents (residents and hospitals),combine some pairs of agents into couples,find maximum size matchings,find maximum size and maximum weight stable matchings.StatusFile formatsThis package supports a number of file formats. For these, we will talk about
the set of "left" and "right" agents. These are the two bi-partitions of the
agents, such that agents on the left may only express preferences for agents on
the right, and vice-versa.The Glasgow formatThis format used by researchers working at the University of Glasgow, or their collaborators.The first line should just be a zero (0). The next two lines contain the number
of agents in the left and right partitions respectively. Following this, we
have one line for each agent on the left, and then one line for each agent on
the right. These are as follows:For agents on the left, first the line contains an identifier (numeric only),
and then the preferences. Preferences within brackets indicate a tie.For agents on the right, first the line contains an identifier (numeric only),
and then the agent's capacity, and then the preferences. Preferences within
brackets indicate a tie.SMTI-GRPA CSV file containing a row-column matrix, with the first row and columns used
as identifiers, can be read in to create an instance of SMTI-GRP.There is also a second format for SMTI-GRP, which does not have headings. This
file contains, as its first two lines, the number of rows and columns
respectively. The rest of the file is the matrix of scores, separated by spaces
only.Future plansThis mostly started as a tool to inspect instances of HRTC for various parameters, but it is growing. One day I might even write up a model that would solve HRTC, but that day is not today.Can I help?Yes! If you want to add features, or request features, please just raise an issue. I can't promise anything, but it's good to know what people want.
Package: pyhsd
Humanized String Distance AlgorithmThis project is created and maintained byInventives, Inc., and is licensed under theCreative Commons Attribution-NonCommercial 4.0 International License.AboutTheHumanized String Distance(HSD) algorithm is based on a modified dynamic-time-warping solution to compare two strings. The HSD algorithm accounts for closeness of characters based on handwritten and/or extracted (OCR) text. For example, theicharacter looks similar tojand handwriting recognition systems may easily mistake them for each other based on the writing style. Handwritten or extracted characters likeBand8are easily confused, similar toSand5,.and,and many more. The HSD algorithm is a lot more tolerant of these and improves the performance of string distance calculation to match extracted text to a known set of values.The HSD algorithm takes in the extracted text, and expected/desired text as arguments, and provides a modified string distance score.The expected/desired string may include lower case alphabets, numbers, and various special characters including:Space ( )Period (.)Comma (,)Hyphen (-)InstallationInstall from thepippackage manager.pip install pyhsdOr, install from source.pip install setuptools pybind11 wheel
pip install -e .Usageimport pyhsdCalculate HSD distance between two stringsd = pyhsd.distance('he110', 'hello')Find closest match from a list of optionsnumMatches = 1
matches = pyhsd.match('he110', [ 'hello', 'world' ], numMatches)Each match is an instance of theMatchclass which contains propertiesvaluerepresenting the string it matched, anddistancewith the HSD distance for the match.Custom transitions fileTo match with custom transitions, you may pass a CSV file whch maps possible extracted characters (rows) to desired characters (columns). The corresponded cell for each row-column represents a score on the scale 0 to 1 representing how similar the characters are. For instance,qandvare rarely confused, so they have a low score (0), butbandhmay be confused easily, giving them a higher score (0.3). If the row and column characters are the same, then the cell value will be 1 representing an exact match.
Package: py-hsm
A simplified, easy to use PKCS#11 HSM client for Python.
You can use any PKCS#11 (aka Cryptoki) module supplied by vendors of Hardware
Security Modules (HSMs) such as SafeNet/Gemalto Luna, Utimaco, FutureX, Thales, Cavium,
and DNSSec’s SoftHSM.  This client supports the PKCS 11 OASIS standard v2.20 and requires
the companion, cross-platform, open source shared library libhsm.so / libhsm.dll.The source code to compile and install libhsm.so can be found via the following link.https://github.com/bentonstark/libhsm/archive/2.4.0.zip
Package: pyhspf
PyHSPF contains a library of subroutines to run the Hydrological
Simulation Program in Fortran (HSPF), Python extensions to the HSPF
library, and a series of classes for building HSPF input files,
performing simulations, and postprocessing simulation results.HSPF requires flowline and catchment data for a stream network, land use
data for the stream reach subbasins, time series of climate and hydrology
data. A series of preprocessing classes were developed to extract data
from the following publically-available databases on the World Wide Web:National Hydrography Dataset Plus Version 2 (NHDPlus)National Water Information System (NWIS)National Inventory of Dams (NID)Cropland Data Layer (CDL)National Solar Radiation Database (NSRDB)Global Historical Climate Network Daily (GHCND)Global Summary of the Day (GSOD)Hourly Precipitation Database (DSI-3240)The “core” module requires NumPy, SciPy, and Matplotlib, and can be used to
generate the HSPF input files. The preprocessing routines require GDAL,
PyShp, and Pillow.PyHSPF can be used to assimilate the data into an HSPF model, build the
HSPF input files, simulate the model over a period of time, and then
provide statistics and plots of the simulation output. A series
of examples is provided to illustrate PyHSPF usage.
Package: pyhss
pyhssA python package for hierarchically semiseparable matrix representationHierarchically semiseparable (HSS) matrix representation is a subclass of hierarchical matrices (H-matrices), which allows fast matrix multiplication, Cholesky decomposition, and other matrix computations. The HSS matrix representation is a hierarchical representation that is based on a recursive row and column partitioning of the matrix. Each k-level HSS representation is associated with k+1 level HSS tree on which all blocks of HSS matrices including the whole matrix can be represented.  This package allows Python user to transform their matrix into HSS matrix representation seamlessly.InstallInstall pyhss simply bypipinstallpyhssUsageFor b = Ax we can implementfrompyhssimporthssfrompyhssimporthss_matmulA=np.random.randn(100,100)x=np.random.randn(100,1)hss_mat=hss(maxdepth=10).build(A)b=hss_matmul(A,x)print(LA.norm(b-np.dot(A,x),2))
Package: pyhstr
pyhstrInspired by hstr,pyhstris a history suggest box that lets you quickly search, navigate, and manage your Python shell history. At this point, it supports the standard Python shell, IPython, and bpython. The plan is to support ptpython as well, but some help is needed for that to happen (seeissue #7).Installationpip install pyhstrUsageThestandardshell andbpython:>>>frompyhstrimporthh>>>hhIPython:In [1]: import pyhstr
In [2]: %hhMaking an alias should be more convenient though, for example:aliaspy='python3 -ic "from pyhstr import hh"'ScreencastDevelopmentYou will needpoetry, preferably with these options in config:virtualenvs.create=truevirtualenvs.in-project=trueThen clone the repo, cd into it, make a venv, activate it, and install the project:gitclonehttps://github.com/adder46/pyhstrcdpyhstr
poetryenvusepython3
..venv/bin/activate
poetryinstallTo run tests, mypy checks, and style checks, you need to have Pythons:3.73.83.9For installing all the Python versions, I recommendpyenv.Once you have them, run:toxLicensingLicensed under theMIT License. For details, seeLICENSE.
Package: pyht
PlayHT API SDKpyhtis a Python SDK for thePlayHT's Text-to-Speech API. Withpyht, you can easily convert text into high-quality audio streams in humanlike voice.FeaturesStream text-to-speech in real-time.Use prebuilt voices or custom voice clones.Supports WAV, MP3, PCM, Mulaw, FLAC, and OGG audio formats.RequirementsPython 3.8+numpysimpleaudioInstallationYou can install thepyhtSDK using pip:pipinstallpyhtUsageYou can use thepyhtSDK by creating aClientinstance and calling itsttsmethod. Here's a simple example:frompyhtimportClientfromdotenvimportload_dotenvfrompyht.clientimportTTSOptionsimportosload_dotenv()client=Client(user_id=os.getenv("PLAY_HT_USER_ID"),api_key=os.getenv("PLAY_HT_API_KEY"),)options=TTSOptions(voice="s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json")forchunkinclient.tts("Can you tell me your account email or, ah your phone number?",options):# do something with the audio chunkprint(type(chunk))For a more detailed example with command-line arguments and interactive mode, refer to the provided demo.Command-Line DemoYou can run the provideddemofrom the command line.Note:This demo depends on the following packages:pipinstallnumpysimpleaudiopythondemo/main.py--userYOUR_USER_ID--keyYOUR_API_KEY--text"Hello from Play!"Alternatively, you can run the demo in interactive mode:pythondemo/main.py--userYOUR_USER_ID--keyYOUR_API_KEY--interactiveIn interactive mode, you can input text lines to generate and play audio on-the-fly. An empty line will exit the interactive session.Get an API KeyTo get started with thepyhtSDK, you'll need your API Secret Key and User ID. Follow these steps to obtain them:Access the API Page:
Navigate to theAPI Access page.Generate Your API Secret Key:Click the "Generate Secret Key" button under the "Secret Key" section.Your API Secret Key will be displayed. Ensure you copy it and store it securely.Locate Your User ID:
Find and copy your User ID, which can be found on the same page under the "User ID" section.Keep your API Secret Key confidential. It's crucial not to share it with anyone or include it in publicly accessible code repositories.
Package: pyhtcc
PyHTCCAn (unofficial) library for interfacing with a Honeywell Total Connect Comfort (TCC) thermostat system. It includes both a simple CLI and an API.Installationpip install pyhtccSimple API Examplefrom pyhtcc import PyHTCC
p = PyHTCC(<TCC username>, <TCC password>)
zone = p.get_zone_by_name('<zone name>')

# set cooling on, and a setpoint of 75 degrees
zone.set_permanent_cool_setpoint(75)Seehttps://csm10495.github.io/pyhtcc/for full API documentation.CLI Syntaxusage: pyhtcc [-h] [-u USER] [-p PASSWORD] [-n NAME] [-s] [-d] [-l]
              [-H HEAT | -C COOL]

A CLI to perform actions on a Honeywell Total Comfort Connect thermostat
system

options:
  -h, --help            show this help message and exit
  -u USER, --user USER  Username to login to TCC. If not given uses the
                        environment variable PYHTCC_EMAIL
  -p PASSWORD, --password PASSWORD
                        Password to login to TCC. If not given uses the
                        environment variable PYHTCC_PASS. If neither are
                        given, will prompt for user input.
  -n NAME, --name NAME  Thermostat name to target. If not given, targets all
                        zones
  -s, --show-info       If given, will show info and quit.
  -d, --debug           If given, will log to stdout
  -l, --logout          if given, will logout from TCC after performing
                        actions.
  -H HEAT, --heat HEAT  Set a target heat temperature
  -C COOL, --cool COOL  Set a target cooling temperatureLicenseMIT License
Package: pyhtgen
HTML.pyThis module provides a few classes to easily generate HTML tables and lists.Author: Philippe LagadecProject website:http://www.decalage.info/python/htmlLicense: CeCILL (open-source GPL compatible), see source code for details.http://www.cecill.infoINSTALLATION:on Windows, double-click on install.bat, or type “setup.py install” in a CMD
window.on other systems, type “python setup.py install” in a shell.HOW TO USE THIS MODULE:First have a look at HTML_tutorial.py. It provides examples of how to use
HTML.py.
Seehttp://www.decalage.info/python/htmlfor additional information and updates.
For complete reference see HTML.py.html, and also the source code of HTML.py.
Package: pyhtm
ANTARES HTM UtilitiesANTARES Utilities for working with Hierarchical Triangular Meshes (HTMs).Free software: MIT licenseDocumentation:https://noao.gitlab.io/noao/antares/htmInstallationYou can install the library from PyPI throughpip:$ pip install pyhtmOr from source:$ git clone https://gitlab.com/noao/antares/htm
$ cd htm
$ git checkout v0.1.3
$ python setup.py installCreditsThis package was created withCookiecutterand NOAO’scookiecutters/python-packagetemplate
(forked fromaudreyr/cookiecutter-pypackage).ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog0.1.5 (2019-09-27)FixedRaise htm.PrecisionError when encountering precision issues in edge-intersection
solver.0.1.4 (2019-09-27)FixedWorkaround for precision issues in edge-intersection solver.0.1.1 (2019-09-27)FixedWrong URLs in docs0.1.0 (2019-08-26)AddedFirst release.
Package: pyhtmd
一款Python版本的HTML转markdown解析器，不使用任何第三方工具，实验demo请勿使用于生成环境，这个只是一次尝试demo项目注意：无法解析多层级HTML只能是单Node这项目目前只针对tensorflow-docs项目存在个别自定义标签无法识别，基本可以适用平常场景python官方html_parserhttps://docs.python.org/zh-cn/3.7/library/html.parser.htmlhtml.parser 源码https://github.com/python/cpython/blob/3.7/Lib/html/parser.py不支持美化后的HTML内容，需要内容紧凑parsersingle html node elementinfinite html list node elementimghead html node elementtodo 开发中核心的问题是，粘在一起的代码如何拆分？本质还是要分割的，但具体怎么分割呢？tablebug已解决list算法问题：当前的list 标签算法无法解析这种结构：因为算法中，假定是依次序性ul组成结束的标签核心算法一：算出开始标签的level核心算法二：根据左边的开始标签索引值算出其所对应的右边索引值序列，我自己给他起了一个炫酷拽炸天的名字：标记逆序奇偶互斥算法上面两个算法我自己算出来的，第一个花了两天，第二个花了1-2周installpip install pyhtmdusagefrompyhtmdimportPyhtmdhtml="<code> Hello, world ! by Pyhtmd. </code>"md=Pyhtmd(html)content=md.markdown()print(content)# `Hello, world ! by Pyhtmd.`APIPyhtmd(html,
language="",
img=True
)language：类型 string （js、python、java等）img:{Boolean}，默认True，可以不需要img渲染frompyhtmdimportPyhtmdhtml="<pre><code>import time\nprint(time.time()) </code><pre>"md=Pyhtmd(html,language="python")content=md.markdown()print(content)# `Hello, world ! by Pyhtmd.`
Package: pyhtml2md
pyhtml2mdpyhtml2md provides a way to use the html2md C++ library in Python. html2md is a fast and reliable library for converting HTML content into markdown.InstallationBasic usageAdvanced usageSupported TagsLicense[TOC]InstallationYou can install using pip:pip3installpyhtml2mdBasic usageHere is an example of how to use the pyhtml2md to convert HTML to markdown:importpyhtml2mdmarkdown=pyhtml2md.convert("<h1>Hello, world!</h1>")print(markdown)Theconvertfunction takes an HTML string as input and returns a markdown string.Advanced usagepyhtml2md provides aOptionsclass to customize the generation process.You can find all information on the c++documentationHere is an example:importpyhtml2mdoptions=pyhtml2md.Options()options.splitLines=Falseconverter=pyhtml2md.Converter("<h1>Hello Python!</h1>",options)markdown=converter.convert()print(markdown)print(converter.ok())Supported Tagspyhtml2md supports the following HTML tags:TagDescriptionCommentaAnchor or linkSupports thehref,nameandtitleattributes.bBoldblockquoteIndented paragraphbrLine breakciteInline citationSame asi.codeCodeddDefinition datadelStrikethroughdfnDefinitionSame asi.divDocument divisionemEmphasizedSame asi.h1Level 1 headingh2Level 2 headingh3Level 3 headingh4Level 4 headingh5Level 5 headingh6Level 6 headingheadDocument headerIgnored.hrHorizontal lineiItalicimgImageSupportssrc,alt,titleattributes.liList itemmetaMeta-informationIgnored.olOrdered listpParagraphprePreformatted textWorks only withcode.sStrikethroughSame asdel.spanGrouped elementsDoes nothing.strongStrongSame asb.tableTableTables are formatted!tbodyTable bodyDoes nothing.tdTable data cellUsesalignfromth.tfootTable footerDoes nothing.thTable header cellSupports thealignattribute.theadTable headerDoes nothing.titleDocument titleSame ash1.trTable rowuUnderlinedUses HTML.ulUnordered listLicensepyhtml2md is licensed underThe MIT License (MIT)
Package: pyhtml2pdf
pyhtml2pdfSimple python wrapper to convert HTML to PDF with headless Chrome via selenium.Installpip install pyhtml2pdfDependenciesSelenium Chrome Webdriver(If Chrome is installed on the machine you won't need to install the chrome driver)GhostscriptExampleConvert to PDFUse with website urlfrom pyhtml2pdf import converter

converter.convert('https://pypi.org', 'sample.pdf')Use with html file from local machineimport os
from pyhtml2pdf import converter

path = os.path.abspath('index.html')
converter.convert(f'file:///{path}', 'sample.pdf')Some JS objects may have animations or take a some time to render. You can set a time out in order to help render those objects. You can set timeout in secondsconverter.convert(source, target, timeout=2)Compress the converted PDFSome PDFs may be oversized. So there is a built in PDF compression feature.The power of the compression,0: default1: prepress2: printer3: ebook4: screenconverter.convert(source, target, compress=True, power=0)Pass Print OptionsYou can use print options mentionedhereconverter.convert( f"file:///{path}", f"sample.pdf", print_options={"scale": 0.95} )Compress PDFUse it to compress a PDF file from local machineimport os
from pyhtml2pdf import compressor

compressor.compress('sample.pdf', 'compressed_sample.pdf')Inspired the works from,https://github.com/maxvst/python-selenium-chrome-html-to-pdf-converter.githttps://github.com/theeko74/pdfc
Package: pyhtmlconv
pyhtmlconv: html converter (image / pdf)python html converter (image / pdf)InstallationAnda perlu menginstallwkhtmltopdf, sebelum menginstall modul ini.pipinstallpyhtmlconvExampleimportpyhtmlconvashtmlurl="https://google.com"image=html.convert_to_image(url,"jpeg")withopen("test_image.jpeg","wb")asfp:fp.write(image)pdf=html.convert_to_pdf(url)withopen("test_file.pdf")asfp:fp.write(pdf)Anda juga dapat mengkonversikan data (image atau pdf) ke bentukdata uridengan cara menambahkan nilaiTruepada parameterdatauridi fungsiconvert_to_imageatauconvert_to_pdf.
Package: pyhtmlgen
pyhtmlpyhtml is a little toolbox which allows you to write html content within your
python script into a variable. This variable then can be saved to a .html file
and be opened with any standard browser.Where to get it# PyPIpipinstallpyhtmlgensupported html objectsh1, h2, h3paragraphsline breakstableslinkspicturessupported python objectsstringsnumpy matricespandas dataframesplotly figuresHow to usewothin your python code create a variable to store a stringuse generators.start('Title of your page') to add the html headadd content as needed using the other functionsuse generators.end() to close the html file correctlywrite the variable to a fileHave a look at the example.py script for more information on GitHubhttps://github.com/danvran/pyhtmlgen
Package: pyhtmlinfo
PyhtmlinfoPyhtmlinfo is a python library that can be used to learn about html tags
you can get info about latest tags and deprecated tags tooInstallationUsing PyPipython pip install pyhtmlinfoUsing this Github Repopython pip install git+https://github.com/amr2018/pyhtmlinfo.gitExamplesfrompyhtmlinfoimportHtmlInfohtml_info=HtmlInfo()tags_list=html_info.all_tags(deprecated=True)# Returns all tags, set deprecated False to return only working tags.tag=html_info.name_to_tag('h1')# --> <h1>tag_name=html_info.tag_to_name('<h1>')# --> h1tag_description=html_info.tag_description('<img>')# --> The <img> HTML element embeds an image into the document.is_tag=html_info.is_html_tag('<h1>')# --> Trueis_deprecated=html_info.is_deprecated('acronym')# --> TrueCreditsTags and Description fromdeveloper.mozilla.org
Package: pyhtmllib
HtmlLib is a free python package, using to discribe html page with Python.
It is built by PointCode Organization and released on the platform of Python.
We highly recommended it to you because of 3 advantages:
1. The project is made of python, which means light, reliable and Cross-Platform.
2. Compared with others packages, it is much simpler in frame and easier to use.
3. It is useful and international to control html web.
Package: pyHTMLParser
It is aimed to provide jquery like API.ExamplefrompyHTMLParser.QueryimportQ_open,Q_close,QQ_open('http://www.example.com')second_target_link=Q('a[href$="-target.html"]:nth-child(2)')print(second_target_link.attr('href'))>>>http://www.some-target.com/example.htmlQ_close()DocumentationAPI Docs.