Saravanan666/pypi-org huggingface dataset:
Package: aiounittest
aiounittestInfoTheaiounittestis a helper library to ease of your pain (and boilerplate), when writing a test of the asynchronous code (asyncio). You can test:synchronous code (same as theunittest.TestCase)asynchronous code, it supports syntax withasync/await(Python 3.5+) andasyncio.coroutine/yield from(Python 3.4)In the Python 3.8 (release note) and newer consider to use theunittest.IsolatedAsyncioTestCase. Builtinunittestmodule is now asyncio-featured.InstallationUse pip:pip install aiounittestUsageIt’s as simple as use ofunittest.TestCase. Full docs athttp://aiounittest.readthedocs.io.importasyncioimportaiounittestasyncdefadd(x,y):awaitasyncio.sleep(0.1)returnx+yclassMyTest(aiounittest.AsyncTestCase):asyncdeftest_async_add(self):ret=awaitadd(5,6)self.assertEqual(ret,11)# or 3.4 way@asyncio.coroutinedeftest_sleep(self):ret=yield fromadd(5,6)self.assertEqual(ret,11)# some regular test codedeftest_something(self):self.assertTrue(True)Library provides some additional tooling:async_test,AsyncMockIteratormocking forasync for,futurizedmock for coroutines.LicenseMIT
Package: aiounu
aiounuAn asyncio module forunuin Python3 using aiohttp. Forked fromvcinex/unu.InstallpipinstallaiounuUseimportaiounuasunutest_url="https://example.com/?test=52e838e8-0943-4ccb-bfd8-ae6bb3173bd2"unu_resp=awaitunu.shorten(url=test_url,output_format="dot",keyword="")print(unu_resp.shorturl)Example ResultIfoutput_formatis set todot(The default), the resulting JSON object properties will be accessible (Thanks tomo-dots) by both dot.notation and dict['notation'].{"url":{"keyword":"kfuns","url":"https://example.com/?test=52e838e8-0943-4ccb-bfd8-ae6bb3173bd2","title":"Example Domain","date":"2020-12-22 08:44:33","ip":"22.42.219.59"},"status":"error","message":"https://example.com/?test=52e838e8-0943-4ccb-bfd8-ae6bb[...] added to database<br/>(Could not check Google Safe Browsing: Bad Request)","title":"Example Domain","shorturl":"https://u.nu/kfuns","statusCode":200}Only theurlvariable is necessary. For a runnable example, seetests/test_shorten.pyor clone the repo
and runpytest.MIT License
Package: aiourlshortener
# aiourlshorteneraiourlshortener is a [asyncio](https://pypi.python.org/pypi/asyncio) python3 compatible library for URL shorting using [Googl](https://goo.gl/), [Bitly](https://bitly.com/) API# Installing```pip3 install aiourlshortener```# Requirements* [asyncio](https://pypi.python.org/pypi/asyncio) or Python 3.4+* [aiohttp](https://pypi.python.org/pypi/aiohttp)# UsageCreate a Shortener instance passing the engine as an argument.## Goo.gl Shortener`api_key` required```pythonimport asynciofrom asyncio import coroutinefrom aiourlshortener import Shortener@coroutinedef main():shortener = Shortener('Google', api_key='API_KEY')url = 'https://github.com/blikenoother/aiourlshortener'# shortshort_url = yield from shortener.short(url)print('short url: {}'.format(short_url))# expandlong_url = yield from shortener.expand(short_url)print('long url: {}'.format(long_url))if __name__ == '__main__':loop = asyncio.get_event_loop()loop.run_until_complete(main())```## Bit.ly Shortener`access_token` required```pythonimport asynciofrom asyncio import coroutinefrom aiourlshortener import Shortener@coroutinedef main():shortener = Shortener('Bitly', access_token='ACCESS_TOKEN')url = 'https://github.com/blikenoother/aiourlshortener'# shortshort_url = yield from shortener.short(url)print('short url: {}'.format(short_url))# expandlong_url = yield from shortener.expand(short_url)print('long url: {}'.format(long_url))if __name__ == '__main__':loop = asyncio.get_event_loop()loop.run_until_complete(main())```
Package: aio-usb-hotplug
aio-usb-hotplugaio-usb-hotplugis a Python library that provides asynchronous generators
yielding detected hotplug events on the USB buses.Requires Python >= 3.8.Works withasyncioandtrio.InstallationUse the package managerpipto installaio-usb-hotplug.pipinstallaio-usb-hotplugaio-usb-hotplugdepends onPyUSB, which
in turn requireslibusboropenusb. An easy way to satisfy
this requirement is to installlibusb-package, which supplies
pre-compiled binaries for most platforms:pipinstalllibusb-packageaio-usb-hotplugwill make use oflibusb-packageif it is installed in
the current Python environment.UsageDump all hotplug events related to a specific USB devicefromaio_usb_hotplugimportHotplugDetectorfromtrioimportrun# ...or asyncioasyncdefdump_events():detector=HotplugDetector.for_device(vid="1050",pid="0407")asyncforeventindetector.events():print(repr(event))trio.run(dump_events)Run an async task for each USB device matching a VID/PID pairfromaio_usb_hotplugimportHotplugDetectorfromtrioimportsleep_foreverasyncdefhandle_device(device):print("Handling device:",repr(device))try:# Do something meaningful with the device. The task gets cancelled# when the device is unplugged.awaitsleep_forever()finally:# Device unplugged or an exception happenedprint("Stopped handling device:",repr(device))asyncdefhandle_detected_devices():detector=HotplugDetector.for_device(vid="1050",pid="0407")awaitdetector.run_for_each_device(handle_device)trio.run(handle_detected_devices)ContributingPull requests are welcome. For major changes, please open an issue first to
discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: aiousps
This is a simple async Python wrapper for the USPS API. It was forked from theusps-apiproject to make an async version. Instead of having to deal with XML, use this library and receive well formatted dictionaries back for tracking shipments, creating shipments, and validating addresses.InstallationNOTE:aiouspsis not yet published on pypi, so you’ll have to install from source.To install usps-api, use pip:pip install aiouspsOr to install from source:python setup.py installConfigurationNote: In order to use any of these APIs, you need to register with USPS and get aUSERID. For the create_shipment endpoint, you will also need to request further permissions by emailinguspstechnicalsupport@mailps.custhelp.comabout Label API access.The USPS developer guide is available athttps://www.usps.com/business/web-tools-apis/general-api-developer-guide.htmUsageTrack ShipmentsfromuspsimportUSPSApiusps=USPSApi('XXXXXXXXXXXX')track=usps.track('00000000000000000000')print(track.result)Create ShipmentThecreate_shipmentfunction needs a to and from address, weight (in ounces), service type and label type. Service types and lable types can be found inusps/constants.py. Defaults areSERVICE_PRIORITYandLABEL_ZPL.fromuspsimportUSPSApi,AddressfromuspsimportSERVICE_PRIORITY,LABEL_ZPLto_address=Address(name='Tobin Brown',address_1='1234 Test Ave.',city='Test',state='NE',zipcode='55555')from_address=Address(name='Tobin Brown',address_1='1234 Test Ave.',city='Test',state='NE',zipcode='55555')weight=12# weight in ouncesusps=USPSApi('XXXXXXXXXXXX',test=True)label=usps.create_label(to_address,from_address,weight,SERVICE_PRIORITY,LABEL_ZPL)print(label.result)Validate AddressfromuspsimportUSPSApi,Addressaddress=Address(name='Tobin Brown',address_1='1234 Test Ave.',city='Test',state='NE',zipcode='55555')usps=USPSApi('XXXXXXXXXXXX',test=True)validation=usps.validate_address(address)print(validation.result)LicenseMIT. SeeLICENSEfor more details.
Package: aioutilities
aioutilitiesasyncio-powered coroutine worker pool. No more juggling bounded semaphores and annoying timeouts, and allows you to run through millions of pieces of data efficiently.Installationpython-mpipinstall-UaioutilitiesCreditsThis is refactored and built on top ofhttps://github.com/CaliDog/asyncpoolExample UsagefromasyncioimportQueue,ensure_future,run,sleepfromaioutilities.poolimportAioPoolasyncdefexample_coro(initial_number:int,result_queue:Queue[int])->None:result=initial_number*2print(f"Processing Value! ->{initial_number}* 2 ={result}")awaitsleep(1)awaitresult_queue.put(initial_number*2)asyncdefresult_reader(queue:Queue[int|None])->None:whileTrue:value=awaitqueue.get()ifvalueisNone:breakprint(f"Got value! ->{value}")asyncdefexample()->None:result_queue=Queue[int|None]()reader_future=ensure_future(result_reader(result_queue))# Start a worker pool with 10 coroutines, invokes `example_coro` and waits for# it to complete or 5 minutes to pass.pool=AioPool[int](name="ExamplePool",task=example_coro,worker_qty=10,timeout=300,)asyncwithpool.spawn()asworkers:foriinrange(50):awaitworkers.push(i,result_queue)awaitresult_queue.put(None)awaitreader_futuredefrun_example()->None:run(example())
Package: aioutils
## History### 2015.03.120.3.10 releasedo not raise asyncio.InvalidStateError### 2015.03.110.3.9 releasefix a bug will cause yielder stuck### 2015.03.050.3.8 releasewhen GeneratorExit cancel all pending tasksyielder related status cleanups### 2015.03.020.3.4-0.3.7 releasecreate new event loop if using in a threadfix semaphore order so that loop must existadd test to test this behaviourcleanup _safe_yield_from that are not needed anymoreuse is_running (how can I not using that!!)### 2015.02.280.3.3 releasefixed Pool’s potential thread unsafe problemfixed Yielder hangs when no items to yieldadd pool size argument to yielder family### 2015.02.270.3.2 releasetypo fix0.3.1 releaseadd put method for manually yield items0.3.0 releaseadd Yielder and OrderedYielder to replace Bag and OrderedBagfix thread safe problem #2 in Yielder and Group mixed usage### 2015.02.260.2.1 releasefix thread unsafe problem### 2015.02.260.2.0 releaseadd Bag and OrderedBagrename to “aioutils”### 2015.02.250.1.2 releasefix some release problems0.1.1 releasebasic group and pool implemenation### 2015.02.23ideas, prototypes
Package: aiovalidator
Exampleimport asyncio

from aiohttp import web

from aiovalidator import (
    validator_factory,
    middleware_exception,
    IntegerField
)


async def foo_validator(value):
    await asyncio.sleep(1)
    return value


def foo_default(value):
    async def default():
        return value

    return default


class Hello(web.View):
    class Field:
        field1 = IntegerField()
        field2 = IntegerField(required=False, methods={'GET'},
                              verbose_name='Field method get')
        field3 = IntegerField(validator=foo_validator, )
        field4 = IntegerField(default=foo_default)

    @asyncio.coroutine
    def get(self):
        fields = self.request['fields']
        print(fields)
        return web.json_response()


app = web.Application(middlewares=[validator_factory(), middleware_exception])
app.router.add_get('/{user_id}/', Hello)
web.run_app(app, port=8000)My fields exampleimport phonenumbers
from aiovalidator import StrField, abort


class PhoneField(StrField):
    def get_value(self, value):
        value = super().get_value(value)
        try:
            value = phonenumbers.parse(value, 'RU')
            region = phonenumbers.region_code_for_number(value)
            regions = phonenumbers.COUNTRY_CODE_TO_REGION_CODE[7]
            if not phonenumbers.is_valid_number(value):
                abort(status=400,
                      text='Field {} not format phone'.format(self.name))
            if region not in regions:
                abort(status=400,
                      text='Field {} not format phone'.format(self.name))
            value = phonenumbers.format_number(
                value, phonenumbers.PhoneNumberFormat.E164
            )[1:]

            return value
        except phonenumbers.NumberParseException:
            abort(status=400, text='Field {} not valid'.format(self.name))
Package: aiovault
aiovault 1.1.1 releaseMinor bugfixesaiovault 1.0.0 releaseFirst major release. Should be pretty stable… all the tests pass so cant be too bad.This library is mainly just a glorified wrapper around aiohttp calling the many Vault URLs. Eventually I want to add some helper methods to make using vault with microservices easier, like
having a coroutine which will just sit there renewing tokens/secrets etc…ExampleSimple example of authenticating with vault and then writing then reading a secretimportaiovaultwithaiovault.VaultClient(token='6c84fb90-12c4-11e1-840d-7b25c5ee775a')asclient:is_authed=awaitclient.is_authenticated()print(is_authed)# Trueawaitclient.secrets.generic.create('some_secret',key1='value1',key2='value2')secret=awaitclient.secrets.generic.read('some_secret')print(secret['key1'])# value1print(secret['key2'])# value2Documentationhttps://pyaiovault.readthedocs.io/en/latest/FeaturesToken, GitHub, AppRole, LDAP, RADIUS and User/Password Authentication backendsGeneric Secret, Consul, TOTP and Transit backendsFile and Syslog Audit backendsPolicy managementBackend renamingInitialization, seal and health managementTODO (Near future)Improve code coverageSecret backends: Databases, RabbitMQ, CubbyholeAuth backends: Okta, AWS (hopefully)TODO (Long term)More docs, more examplesPossibly utility functions like a coroutine to keep renewing a token/secretPolicy validation with hcl library?Socket audit backendTLS auth supportPKI, SSH secret supportTestingAs many of the unit tests that can, interact directly with Vault/Consul/LDAP/RADIUS without mocking. Currently my reasoning is that this way, if we change the variable that
determins the vault version and incompatabilites in the REST interface were introduced they would appear immediatly in the masses of failing unit tests.CreditsI used the _Cookiecutter package to setup the initial project. Was pretty good.And most of the credit goes to the wonderful _aiohttp library which this library is pretty much a wrapper around.LicenseFree software: GNU General Public License v3Documentation:https://aiovault.readthedocs.io.History1.1.1 (2017-11-16)Updated readme1.1.0 (2017-11-16)Fixed verify=False bug1.0.0 (2017-07-29)First stable release0.2.0 (2017-07-20)Switched to use the dev version of Python 2.6Fixed link target in READMEFixed typo in README code exampleAdded AppRole authentication backendAdded Transit secret backendCreated test harness for running Vault in non dev modeAdded Seal/Unseal, initialization and health methods0.1.3 (2017-07-17)Fixed rendering of README on PyPI0.1.2 (2017-07-17)Mostly repository maintenance.Updated requirements_dev.txt and setup.pyFixed issue where tox was not passing environment variablesLimited coverage scope to the library not test suite0.1.1 (2017-07-17)First release on PyPI.
Package: aio-videoindexer
aio-videoindexerOverviewAn async video indexer package for queryingMicrosoft Media Services Video Indexerin Python.aio-videoindexer is available under theMIT Licence.InstallationThe package can be found onPyPyand can be installed using pip.$pipinstallaio-videoindexerDocumentationFor more information including usage examples, seehttps://aio-videoindexer.readthedocs.io/en/latest/.ContactFeel free to contact meon Twitter. For bugs, pleaseraise an issue on GitHub.BackgroundThis library is forked from aTeams Vidproject, designed to use video to connect people during the pandemic.ContributingContributions are more than welcome.Create a fork.Create a feature branchgit checkout -b feature/featurenamein theGitflow style.Commit your changesgit commit -am 'Bug: Fixed a bug'usingsemantic commits.Push to the branchgit push.Create a newpull requestfor review when ready, relating tothe issue.
Package: aiovkcom
aiovkcomaiovkcom is a pythonvk.com APIwrapper.
The main features are:authorization (Authorization Code,Implicit Flow)REST APImethodsUsageTo usevk.com APIyou need
a registered app andvk.comaccount.
For more details, seeaiovkcom Documentation.fromaiovkcomimportTokenSession,APIsession=TokenSession(access_token,v='5.101')api=API(session)events=awaitapi.wall.get()friends=awaitapi.friends.get()Passaccess_tokenthat was received after authorization.
For more details, seeaiovkcom Documentation.Installation$pipinstallaiovkcomor$pythonsetup.pyinstallSupported Python VersionsPython 3.5, 3.6, 3.7 and 3.8 are supported.TestRun all tests.$pythonsetup.pytestRun tests with PyTest.$python-mpytest[-kTEST_NAME]Licenseaiovkcom is released under the BSD 2-Clause License.
Package: aiovkmusic
aiovkmusicОписаниеPython пакет для поиска музыки и плейлистов в VK с возможностью асинхронного скачивания аудиозаписей.Что нового в последней версии?УстановкаaiovkmusicсредствамиPyPi:pip install aiovkmusicИ убедитесь, что на ваш компьютер установленffmpeg.Сразу же перейдём к примерам использования:importasynciofromaiovkmusicimportMusic,VKSession,Track,Playlistasyncdefmain():# Создание сессии.# ВАЖНО: подключаемый аккаунт ВК должен быть БЕЗ двухэтапной аутентификации.# (Если переживаете - используйте фейк.)session=VKSession(login='<номер_телефона/электронная_почта>',password='<пароль_от_вконтакте>',session_file_path='session.json')# Получение интерфейса к vk music api.music=Music(user='<ссылка_на_профиль>',session=session)# Получение всех плейлистов указанного пользователя.playlists=music.playlists()# -> [Playlists]forplaylistinplaylists:print(playlist.title)# pyrokinesis# GAME OVER# Live Rock# Получение аудиозаписей указанного плейлиста.playlist_tracks=music.playlist_tracks(playlists[0])# -> [Track]fortrackinplaylist_tracks:print(track.fullname)# 99 Problems - Big Baby Tape kizaru# So Icy Nihao - Big Baby Tape kizaru# Big Tymers - Big Baby Tape kizaru# Поиск по названию (аналогично поиску в VK).tracks=music.search('Три дня дождя',count=5,offset=0,official=True)# -> [Track]fortrackintracks:print(track.fullname)# Вина - Три дня дождя# Демоны - Три дня дождя# Привычка - Три дня дождя# Не выводи меня - МУККА Три дня дождя# Не Киряй - МУККА Три дня дождя# Загрузка переданных аудиозаписей по указанному пути.downloaded_tracks=awaitmusic.download(tracks,bitrate=320,path='music')# -> [Track]fortrackindownloaded_tracks:print(track.path)# music/108481371.mp3# music/62163423.mp3# music/106817510.mp3# music/60284123.mp3# music/105514252.mp3## <--- NEW IN VERSION 1.1.0! --->## Получение аудиозаписей указанного пользователя.user_tracks=music.user_tracks()# -> [Track]asyncio.run(main())Используемые представления данных:classPlaylist:id:intowner_id:inttitle:strplays:inturl:straccess_hash:strclassTrack:id:intowner_id:intcover_url:strurl:strartist:strtitle:strduration:intpath:strfullname:strHow to contact the maintainer:
Package: aiovkmusic_x
aiovkmusic_xОписаниеАсинхронная python библиотека для работы с VK музыкой, является форком aiovkmusic.Установкаaiovkmusic-xсредствамиPyPi:pip install aiovkmusic-xДля работы необходимffmpeg.Примеры использования:importasynciofromaiovkmusic_ximportMusic,VKSession,Track,Playlistasyncdefmain():# Создание сессии.# Двухэтапная аутентификация не поддерживаетсяsession=VKSession(login='<номер_телефона/электронная_почта>',password='<пароль_от_вконтакте>',session_file_path='session.json')# self позволяет взять айди из сессииmusic=Music(user='self',session=session)tracks=music.search("Geoxor",official=True)fortrackintracks:awaitmusic.download(track)asyncio.run(main())Используемые представления данных:classPlaylist:id:intowner_id:inttitle:strplays:inturl:straccess_hash:strclassTrack:id:intowner_id:intcover_url:strurl:strartist:strtitle:strduration:intpath:strfullname:str
Package: aiovodafone
aiovodafonePython library to control Vodafone StationInstallationInstall this via pip (or your favourite package manager):pip install aiovodafoneContributors ✨Thanks goes to these wonderful people (emoji key):This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template.
Package: aiovotifier
Aio-VotifierAn asynchronous MInecraft server votifier client in PythonExample Usage:fromaiovotifierimportVotifierClientimportasyncioasyncdefmain():client=VotifierClient("127.0.0.1",8192,"testservicename","token/rsa key")# VotifierClient.vote(...) automatically determines the protocol and key formatawaitclient.vote("username","user address")awaitclient.vote("user2")awaitclient.v1_vote("username","user address")# only supports v1 protocolawaitclient.nu_vote("username","user address")# only supports NuVotifier/v2 protocolasyncio.run(main())Documentationclassaiovotifier.VotifierClient(host:str, port:int, service_name:str, secret:str)Arguments:host: str-The hostname or IP of the votifier serverport: int-The port of the votifier server, commonly 8192service_name: str-The name of the service that sends the votesecret: str-The public RSA key or the token found inconfig.ymlMethods:vote(username: str, user_address: str = "127.0.0.1")-sends a vote to the votifier server, automatically detects and handles the protocol and type of secretv1_vote(username: str, user_address: str = "127.0.0.1")-sends a Votifier v1 vote to a votifier v1 servernu_vote(username: str, user_address: str = "127.0.0.1") -> dict-sends a NuVotifier / v2 vote to a NuVotifier server, returns the response from the serverclassaiovotifier.VotifierHeader(header:bytes, version:str, token:str= None)Arguments:header: bytes-The header received from the votifier serverversion: str-The version of the votifier serverchallenge: str = None-The challenge, included only if the votifier server is v2/NuVotifierMethods:@classmethod parse(header: bytes)-Returns a newVotifierHeader, parsed from the input bytesfunctionaiovotifier.votifier_v1_vote(r:asyncio.StreamReader, w:asyncio.StreamWriter, service_name:str, username:str, user_address:str, key:cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey)Sends a Votifier v1 vote to a Votifier v1 serverfunctionaiovotifier.nuvotifier_vote(r:asyncio.StreamReader, w:asyncio.StreamWriter, service_name:str, username:str, user_address:str, token:str, challenge:str) ->dictSends a NuVotifier / v2 vote to a NuVotifier serverexceptionaiovotifier.VotifierErrorBase class that all votifier exceptions derive fromexceptionaiovotifier.VotifierHeaderErrorRaised when the header from the votifier server is invalidexceptionaiovotifier.UnsupportedVersionErrorRaised when the votifier version is unsupportedexceptionaiovotifier.NuVotifierResponseErrorRaised when the response from the votifier server contains a status that is not OKCreditsaiovotifier was based off the code and documentation belowhttps://github.com/ano95/votifier2-pyhttps://www.npmjs.com/package/votifier-client/v/0.1.0?activeTab=dependentshttps://github.com/vexsoftware/votifierhttps://github.com/NuVotifier/NuVotifier/wiki/Technical-QA
Package: aiovty
DescriptionInstallationUsageDescriptionaiovtyis an asynchronous implementation of the VTY protocol.InstallationInstall the last released version usingpip:python3-mpipinstall--user-UaiovtyOr install the latest version from sources:gitclonegit@github.com:matan1008/aiovty.gitcdaiovty
python3-mpipinstall--user-U-e.UsageTo create a client, you need to supply the server's prompt name (e.g.'Router'):fromaiovtyimportAioVtyClientvty=AioVtyClient('Router')Then you can connect giving address:connection_string=awaitvty.connect('127.0.0.1',23)Note that connecting returns the "connection string", which is the data sent before the first prompt.After connection you can send your command:command_response=awaitvty.command(b'show ip')You can also enter enabled mode:awaitvty.enable()And initialize a configure terminal:awaitvty.configure_terminal()awaitvty.command(b'router rip')print(vty.node)# Prints `config-router`
Package: aiowallhaven
aiowallhavenaiowallhaven is an asynchronous API wrapper for popular
wallpaper hosting site wallhaven.cc.Basic Usage:import asyncio
from aiowallhaven import WallHavenAPI

wallhaven = WallHavenAPI("Your-API-key")

async def wallpaper_details():
    request = await wallhaven.get_wallpaper("5758y8")
    print(request)

loop = asyncio.get_event_loop()
loop.run_until_complete(wallpaper_details())PrerequisitesThe following dependencies are required:Python 3.10aiohttp libraryaiolimiter libraryInstallation$ pip install aiowallhavenDocumentationThe documentation is available atreadthedocs.io.Licenseaiowallhaven is developed and distributed under the MIT
license.