Saravanan666/pypi-org huggingface dataset:
Package: hoogberta
HoogBERTaThis repository includes the Thai pretrained language representation (HoogBERTa_base) and the fine-tuned model for multitask sequence labeling.Installation$ python setup.py installTo download model, use>>> import hoogberta
>>> hoogberta.download() # or hoogberta.download('/home/user/.hoogberta/')Usagesee test.pyDocumentationTo annotate POS, NE and cluase boundary, use the following commandsfromhoogberta.multitaggerimportHoogBERTaMuliTaskTaggertagger=HoogBERTaMuliTaskTagger(cuda=False)# or cuda=Trueoutput=tagger.nlp("วันที่ 12 มีนาคมนี้ ฉันจะไปเที่ยววัดพระแก้ว ที่กรุงเทพ")Please give the "base path" parameter if you have changed the "models" directory to a different location than the current one, for example.tagger=HoogBERTaMuliTaskTagger(cuda=False,base_path="/home/user/.hoogberta/")The output is a list of annotations (token, POS, NE, MARK). "MARK" is annotation for a single white space that can be PUNC (not clause boundary) or MARK (clause boundary). Note that, for clause boundary classification, the current pretrained model works well with inputs containing two clauses. If you want a more precise result, we recommend running tagger.nlp iteratively.To extract token features, based on the RoBERTa architecture, use the following commandsfromhoogberta.encoderimportHoogBERTaEncoderencoder=HoogBERTaEncoder(cuda=False)# or cuda=Truetoken_ids,features=encoder.extract_features("วันที่ 12 มีนาคมนี้ ฉันจะไปเที่ยววัดพระแก้ว ที่กรุงเทพ")For batch processing,inputText=["วันที่ 12 มีนาคมนี้","ฉันจะไปเที่ยววัดพระแก้ว ที่กรุงเทพ"]token_ids,features=encoder.extract_features_batch(inputText)To use HoogBERTa as an embedding layer, usetokens,features=encoder.extract_features_from_tensor(token_ids)# where token_ids is a tensor with type "long".CitationPlease cite as:@inproceedings{porkaew2021hoogberta,title={HoogBERTa: Multi-task Sequence Labeling using Thai Pretrained Language Representation},author={Peerachet Porkaew, Prachya Boonkwan and Thepchai Supnithi},booktitle={The Joint International Symposium on Artificial Intelligence and Natural Language Processing (iSAI-NLP 2021)},year={2021},address={Online}}Download full-textPDF
Package: hookdns
hookdnsHookDNS is a library which allow you to modify a name resolution in your Python script without any modification in your hosts file or by using a fake DNS resolver.importrequestsfromhookdnsimporthostswithhosts({"example.org":"127.0.0.1"}):...r=requests.get("http://example.org")# the request is sent to your local server...Installationpip install hookdnsUsageCustom DNS resolutions are describe by a dictionnary where the keys are hostnames
and the values the expected corresponding addresses.{
    "hostname1": "addr1",
    "hostname2": "addr2"
}hostname and addr could be a domain name or a string representation of an IPv4/IPV6.Example using the patch as a decoratorimportrequestsfromhookdnsimporthosts@hosts({"example.org":"127.0.0.1"})defmyfunc():...r=requests.get("http://example.org")# the request is sent to your local server...Example using the patch as a context managerimportrequestsfromhookdnsimporthostswithhosts({"example.org":"localhost"}):...r=requests.get("http://example.org")# the request is sent to your local server...OptionsBy default the following function calls are intercepted:socket.gethostbyname, socket.gethostbyname_ex and socket.getaddrinfo.You can limit the interception to only a restricted list of function.importsocketfromhookdnsimporthostswithhosts({"example.org":"localhost"},only=["gethostbyname"]):...addr=socket.gethostbyname("example.org")# returns "127.0.0.1"print("gethostname returns:%s"%addr)_,_,addr=socket.gethostbyname_ex("example.org")# returns the real ip address for example.orgprint("gethostname_ex returns:%s"%addr[0])...gethostname returns: 127.0.0.1
gethostname_ex returns: 93.184.216.34
Package: hooked
Run command on GitHub and BitBucket POST request hooks.InstallYou can installhookedin a virtualenv (withvirtualenvwrapperandpip):$ mkvirtualenv hooked
(hooked) $ pip install hookedOr if you want to contribute some patches tohooked:$ git clone git@github.com:bbinet/hooked.git
$ cd hooked/
$ mkvirtualenv hooked
(hooked) $ python setup.py developConfigureCreate a configuration file that looks like:$ cat path/to/config.cfg

[server]
host = 0.0.0.0
port = 8080
server = cherrypy
debug = true

[hook-myrepo]
repository = myrepo
branch = master
command = /path/to/script.sh

[hook-all]
#repository = # will match all repository
#branch = # will match all branches
command = /path/to/other/script.shNote that the[server]section is optional, the defaults are:[server]
host = localhost
port = 8888
server = wsgiref
debug = falseRunRun the hooked server by running the following command:(hooked) $ hooked path/to/config.cfgThen visithttp://localhost:8888/, it should return the current configuration
for thishookedserver.
If this works, you are ready to configure GitHub and BitBucket POST request web
hooks to yourhookedserver listening address, for example:http://localhost:8888/.See:https://confluence.atlassian.com/display/BITBUCKET/POST+hook+managementhttps://developer.github.com/webhooks/You can also manually run hooks though GET requests:requesting the /hooks/<repo>/<branch> url will run all hooks that match
repository=<repo> and branch=<branch>requesting the /hook/<hook> url will run the hook which name is <hook>ReleaseTo make a new release, do the following steps:$ vi setup.py  # bump version
$ git add setup.py
$ git commit -m "bump version to X.X.X"
$ git tag vX.X.X
$ git push --tags
$ python setup.py sdist uploadThanksThanks to thehook-serverandgithookprojects for inspiration.
Package: hooked-on-django
hooked-on-djangostartup hookAll methods listed under this hook will be executed after Django finishes its startup process.settings.pyINSTALLED_APPS=[...,"hooks.startup",...,]DJANGO_HOOKS={"STARTUP":{"path.to.method":{"delay":0,"args":[...],"kwargs":{...},}}}examplesfile: /path/to.py

def method(param1: str, param2: int):
    ...

def other(param1: str = "", param2: int = 0):
    ...

def another():
    ...To add a hook to each of these methods, the following configuration can be used:DJANGO_HOOKS = {
    "STARTUP": {
        "path.to.method": {
            "delay": 10,
            "args": ["string", 123456]
        },
        "path.to.other": {
            "kwargs": {
                "param1": "string", 
                "param2": 123456
            }
        },
        "path.to.other": {},  # No params needed.
    }
}note: additionaly, the methodmethodwill be executed after a 10 seconds delay.🎣️
Package: hookee
hookeeis a utility that provides command line webhooks, on demand! Dump useful request data to the
console, process requests and responses, customize response data, and configurehookeeand its routes
further in any number of ways through custom plugins.Installationhookeeis available onPyPIand can be installed
usingpip:pipinstallhookeeorconda:condainstall-cconda-forgehookeeThat's it!hookeeis now available as a Python package is available from the command line.Basic Usagehookeemakes it easy to get webhooks on the fly right from the console. Simply start it with:hookeestartWith its default configuration, this will start a server on port 8000, open angroktunnel
usinghookee, and mount a URL at/webhook. Sending any request to
the/webhookendpoint will dump the request and response data to the console.hookeecan be configured in a number of ways to quickly and easily tweak request and response data. For example,
here we are customizing the response body from/webhookusing the--responsearg.hookee--response"<Response>Ok</Response>"--content-typeapplication/xmlTo see the wayshookeecan be tweaked right from the console, view its documented args and commands like this:hookee--helpDocumentationFor more advanced usage, including howhookee's default configuration can be changed, extended through plugins,
API integrations, and more, see its official documentation is available athttp://hookee.readthedocs.io.ContributingIf you would like to get involved, be sure to review theContribution Guide.Want to contribute financially? If you've foundhookeeuseful,sponsorshipwould
also be greatly appreciated!
Package: hookery
Minimally invasive hooks with no metaclasses and no class decorators sincev5.0.0.Statusv3.10.1status isBeta.v5.xstatus isPre-Alpha.I usev3.10.1(https://pypi.org/project/hookery/3.10.1/) in production for work.This document is forv5.xwhich is NOT production-ready yet.Installationpipinstallhookery==3.10.1Basic UsagefromhookeryimportHook,hooksclassProfile:on_activated=Hook()@on_activateddeflog_activation(self):print(f"Activating{self}")defactivate(self):hooks.trigger(self.on_activated)classWarehouseProfile(Profile):@Profile.on_activateddeflog_activation(self):print(f"Warehouse profile{self}is being activated")@Profile.on_activateddefanother_handler(self):print(f"This will also be printed")The dummy example above demonstrates that:a hook registration requires no metaclasses, no base classes, no class decorators.you can register any number of handlers per hook inside the same classa handler calledlog_activationin child class does not override a handler with the same name
in parent class.>>>profile=WarehouseProfile()>>>profile.activate()Activating<__main__.WarehouseProfileobjectat0x103ee66d8>Warehouseprofile<__main__.WarehouseProfileobjectat0x103ee66d8>isbeingactivatedThiswillalsobeprintedLimitationsFor us, hooks and hook handlers are part of the class specification. This means that a class cannot have new hooks
added or new hook handlers registered after the class has been created. If you wish to add functionality you either
modify the class or extend it.@classmethod’s and@staticmethod’s cannot be registered as handlers because hooks apply to instances of
a class, not the class itself.It is best to not decorate handlers with anything else.
Package: hookman
# hookman> github webhooks manageryou just need run as a command in Linux## firstpip install hookman## second
cd your github project and runhookman –run -dit will run in backgroundalso you can set yourprojectdirlikehookman –run -d –projectdir /my/github/project####settingpidfile=~/hookman.pid
logfile=~/hookman.log####blogyou can go to our [blog](http://blog.zhanglun.me/2016/08/18/hookman-development-notebook/) to know how to contribute your code.######Develped by TDD
> you can test it just usepy.test .> latest version “0.1.2”use Apache LICENSE
Package: hookmeup
Hook Me UpA Git hook to automate your Pipenv and Django workflowsRequirementsPython 2.7+FeaturesFires whenever you switch branches withgit checkout, or whenever
you rungit pull, or basically any time Git checks files out into
your worktreeCleans and Syncs your Pipenv if there are changes toPipfileorPipfile.lockMigrates your Django DB to it's current working state, applying and
unapplying migrations as necessaryThe hook detects if Pipenv and/or Django are in use in the current repo,
so you don't need to be using both to take advantage of Hookmeup.Usage$ pip install hookmeup
$ cd $YOUR_PROJECT
$ hookmeup installMore details are available by runninghookmeup --help.ContributingPull requests are welcome, preferably via emailed output ofgit request-pullsent to the maintainer (seeherefor more
information).  Bug reports should also be directed to the maintainer via
email.ReleasesRelease tags will always be signed with the maintainer'sPGP
key(also available on any
publickeyserver).
PGP-signed versions of release tarballs and pre-builtwheelpackages are available onPyPI, with the signature files
living alongside the corresponding artifact (simply append an.ascextension). Because the maintainers of PyPI do not consider PGP
signatures to be a user-facing feature, the extension must be added
manually in your browser's URL bar in order to download the signature
files.Acknowledgmentshookmeup is inspired by Tim Pope'shookuputility for Ruby/Rails (and
hence so is the name).
Package: hook-run
hook-runPython bootstrap to activate a virtual environment (venv, or conda) and run a command. Intended to be used with pre-commit pypi package. Inspired byvenv-runRuns a command from an existing python virtual environment. Script looks
for a private configuration file in the current working directory
hook-run.json. If such file is found, it's expected to follow format:{
    "path": "/home/user/my_project/venv/bin"
}Wherepathpoints to the virtual environment to be used.
If configuration file is not found, then no bootstrapping is performed, but script proceeds with command executionAfter bootstrapping is done, then specified command is executed.
Package: hookshothq
Hookshot Python LibraryThe Hookshot Python library provides convenient access to the Hookshot API from
applications written in the Python language. It includes a pre-defined set of
classes for API resources that initialize themselves dynamically from API
responses which makes it compatible with a wide range of versions of the Hookshot
API.DocumentationSee thePython API docs.InstallationYou don't need this source code unless you want to modify the package. If you just
want to use the package, just run:pipinstall--upgradehookshothqInstall from source with:pythonsetup.pyinstall
Package: hooktools
hooktoolsI have failed to provide a good README.rst in my project, and you should shun
me if I do any pull requestsInstallationTo install the latest release, type:pip install hooktoolsTo install the latest code directly from source, type:pip install git+git://github.com/ambitioninc/hooktools.gitDocumentationFull documentation is available athttp://hooktools.readthedocs.orgLicenseMIT License (see LICENSE)
Package: hookup
Hookup is a Python decorator to monitor one or more attributes on a given object, and trigger a callback function to be called when the attribute(s) value changes.Example:fromhookupimporthookup@hookup(attrs=["version"],callback="update_version")classSoftware:def__init__(self):version=1defupdate_version(self):# This is the callback function that will be called when the attribute's value changeswithopen("version.txt")as_file:_file.write(self.version)software=Software()software.version=2InstallationTo install Hookup, simply:$ pip install hookupUsageHookup is designed to be used as a decorator on a class:@hookup(attrs=["version"],callback="update_version")classSoftware:You must pass in the two required arguments:attrs- a List of attributes that will be watched for changescallback- a function belonging to the class used as a callbackUpon the value of any watched attribute (attrs) changing from one value to another, the callback function will be executed.The callback function will be called with no additional parameters. For example, the following would both be valid callbacks:defcallback(self):defcallback(self,option="default"):ContributingCheck for open issues or open a new issue to kick off discussionFork the repository on Github, create a branch and make your code changesWrite a test which shows that the bug was fixed, or that the new feature works as expectedSend a PR with a clear description of the changeChangelog0.1.1 (2021-11-10)Initial release
Package: hooly-utils-kit
hooly-utils-kit-pyfrom hooly_utils_kit import Validators, FormattersEg..
Formatters.format_phone_number("")
Validators.validate_date("")Validators- validate_date = validates that the date is correct
- is_composed_of_numbers = valid if data is composed of numbers
- is_rut_valid = valid that the rut is validFormatters- format_phone_number = format a number to chilean phone number
- format_to_datetime = format a date to datetime
Package: hoom
HoomBuild your own HomeKit Bridge & Accessories with Hoom🚧Please note: Hoom is still under development. It is not recommended at this point, to use Hoom in a production environment.✨ FeaturesHomeKit BridgeMinimalist Web UICreate custom HomeKit Accessories with function decoratorsCustomizableEasy to use📦 InstallationHoom is available onPyPi. You can easily install it using pip:pipinstallhoomNote: Hoom requires Python 3.8 or higher🚀 Getting startedHere's a demo script which shows how easy Hoom is to use:fromhoomimportHoomfromhoom.accessory_typesimportSwitchhoom=Hoom()@hoom.switch("Switch ")defswitch(response:Switch.Response):ifresponse.on:print("Switch is now on")else:print("Switch is now off")returnhoom.run()As you can see, Hoom is very similar to frameworks like FastAPI. No need for complicated classes with lots of methods. Just use the@hoom.<<accessory>>decorator and you're good to go.If you want to know how to create other accessories,take a look at the documentation.📣 CreditsA special thanks goes out to these Python packages/frameworks and their authors:HAP-python- Hoom wouldn't be possible without this HomeKit Accessory Protocol implementation byIvan KalchevFastAPI- Hoom uses FastAPI bySebastián Ramírezfor its web server & UI and is heavily inspired by itA special thanks also goes out to:Tabler Icons- The icon for Hoom is from Tabler Icons
Package: hoopa
hoopa简介hoopa是一个轻量、快速的异步分布式爬虫框架支持基于内存、redis、rabbitmq的等优先级队列支持aiohttp、 httpx、requests等HTTP库支持断点续传兼容同步和异步代码，不习惯异步的，可以使用同步写，但是要注意的是不能在异步方法里面进行阻塞的操作项目还在开发测试中，请勿用于生产环境，若发现问题，欢迎提issue文档地址：https://fishtn.github.io/hoopa/环境要求：Python 3.7.0+Works on Linux, Windows, macOS安装# For Linux & Macpipinstall-Uhoopa[uvloop]# For Windowspipinstall-Uhoopa开始创建爬虫hoopacreate-sfirst_spider然后添加url：http://httpbin.org/getimporthoopaclassFirstSpider(hoopa.Spider):name="first"start_urls=["http://httpbin.org/get"]defparse(self,request,response):print(response)if__name__=="__main__":FirstSpider.start()todo监控平台远程部署任务调度感谢Tinepeasruiafeapderscrapystarlette
Package: hoopoe-python
PythonHoopoe PythonPython SDK for Hoopoe | Get notified of what's importantExplore the docs »View Demo·Report Bug·Request FeatureAbout The ProjectHoopoeis a platform that helps you notify yourself when something important happens in your platform!Getting StartedThere's two ways to use hoopoe, either you can userHoopoe.appor host it yourself.InstallationGet a free API Key athttps://hoopoe.appInstall PyPI packagespipinstallhoopoe-pythonUsageFirst import hoopoe-python and create an instance of it.fromhoopoeimportHoopoehoopoe=newHoopoe({api_key:'your_hoopoe_api_key',version:'1',# API version, default 1base_url:'https://...',# self-hosted only, ignore if you're using Hoopoe Cloud})Then you can send a notification to yourself using like this:hoopoe.upupa("Your message here",extra={"extra":"info","could":"be","added":"here",})By default theupupacommand will send the code trace back, you have the option to disable it:hoopoe.upupa("",extra={},include_trace_back=False)See theopen issuesfor a full list of proposed features (and known issues).ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/amazing-feature)Commit your Changes (git commit -m 'Add some amazing-feature')Push to the Branch (git push origin feature/amazing-feature)Open a Pull RequestLicenseDistributed under the MIT License. SeeLICENSE.txtfor more information.
Package: hoopR-py
hoopR-pySeeCHANGELOG.mdfor details.hoopR-pyis an Python package for working with men’s basketball data and companion package tohoopRThe package has functions to access live play by play and box score data from ESPN with shot locations when available.InstallationhoopR-py can be installed via pip:pipinstallhoopR-pyor from the repo (which may at times be more up to date):gitclonehttps://github.com/saiemgilani/hoopR-pycdhoopR-py
pipinstall-e.Our AuthorsSaiem GilaniCitationsTo cite thehoopR-pyPython package in publications, use:BibTex Citation@misc{saiemgilani2021hoopRpy,author={Gilani, Saiem},title={hoopR-py: The SportsDataverse's Python Package for Men's Basketball Data.},url={https://hoopR-py.sportsdataverse.org/},year={2021}}
Package: hootsweet
A python API for the HootSuite REST API.InstallationpipinstallhootsweetUsagefromhootsweetimportHootSweetclient_id="Your-HootSuite-Client-ID"client_secret="Your-HootSuite-Client-Secret"redirect_uri="http://redirect.uri/"defhandle_refresh(token):# callback function to save token to a database or filesave_token_to_db(token)client=HootSweet(client_id,client_secret,redirect_uri=redirect_uri,refresh_cb=handle_refresh)# Step 1 get authorization url from HootSuiteurl,state=client.authorization_url()# Step 2 go to url above and get OAuth2 codetoken=client.fetch_token(code)# client.token now contains your authentication token# Step 3 (optional) refresh token periodically, this automatically calls handle_refreshtoken=client.refresh_token()# retrieve data from https://platform.hootsuite.com/v1/meme=client.get_me()# retrieve authenticated members organizations https://platform.hootsuite.com/v1/me/organizationsorganizations=client.get_me_organizations()Messagestoken={"access_token":"e9a90a81-xf2d-dgh3-cfsd-23jhvn76","token_Type":"Bearer","expires_in":2592000,"refresh_token":"82d82cf4-76gf-gfds-nt3k-lzpo12jg","scope":"offline"}client=HootSweet("client_id","client_secret",token=token)# Schedule a messagetext="A message"social_profile_ids=["1234","12345"]send_time=datetime(2020,1,1,12,40,15)message=client.schedule_message(text=text,social_profile_ids=social_profile_ids,send_time=send_time)# Get messagemessage=client.get_message(message_id="98765")# Delete messageclient.delete_message(message_id="98765")Messages with MediaHootSuite uses it’s own AWS Bucket to add media to a message. To
attach media to you message you need to first upload the media
to HootSuite’s bucket.token={"access_token":"e9a90a81-xf2d-dgh3-cfsd-23jhvn76","token_Type":"Bearer","expires_in":2592000,"refresh_token":"82d82cf4-76gf-gfds-nt3k-lzpo12jg","scope":"offline"}client=HootSweet("client_id","client_secret",token=token)mime_type="image/png"file_path=Path("/path/to/file.png")file_size=file_path.stat().st_sizeupload_details=client.create_media_upload_url(file_size,mime_type)upload_url=upload_details["uploadUrl"]media_id=upload_details["id"]# The number of seconds you have to upload the mediaexpires_in=upload_details["uploadUrlDurationSeconds"]# Upload the mediawithfile_path.open("rb")asf:content=f.read()headers={"Content-Type":mime_type,"Content-Length":str(file_size)}# Make sure that this request returns a 200requests.put(upload_url,headers=headers,data=content)# Schedule a messagetext="A message"social_profile_ids=["1234","12345"]send_time=datetime(2020,1,1,12,40,15)media=[{"id":media_id}]message=client.schedule_message(text=text,social_profile_ids=social_profile_ids,send_time=send_time,media=media)