Saravanan666/pypi-org huggingface dataset:
Package: aiorgwadmin
aiorgwadminaiorgwadmin is fork of rgwadmin library.aiorgwadmin is an async Python library to access the Ceph Object Storage Admin API.http://docs.ceph.com/docs/master/radosgw/adminops/API Example UsageimportasynciofromaiorgwadminimportRGWAdminasyncdefmain():rgw=RGWAdmin(access_key='XXX',secret_key='XXX',server='obj.example.com')awaitrgw.create_user(uid='liam',display_name='Liam Monahan',email='liam@umiacs.umd.edu',user_caps='usage=read, write; users=read',max_buckets=1000)awaitrgw.set_user_quota(uid='liam',quota_type='user',max_size_kb=1024*1024,enabled=True)awaitrgw.remove_user(uid='liam',purge_data=True)loop=asyncio.get_event_loop()loop.run_until_complete(main())User Example UsageimportasynciofromaiorgwadminimportRGWAdmin,RGWUserasyncdefmain():RGWAdmin.connect(access_key='XXX',secret_key='XXX',server='obj.example.com')u=awaitRGWUser.create(user_id='test',display_name='Test User')u.user_quota.size=1024*1024# in bytesu.user_quota.enabled=Trueawaitu.save()awaitu.delete()loop=asyncio.get_event_loop()loop.run_until_complete(main())Requirementsaiorgwadmin requires the following Python packages:aiohttprequestsrequests-awsAdditionally, you need to have aCephObject Storage
instance with a user that has appropriate caps (capabilities) on the parts of
the API that you want to access.  See theCeph Object Storagepage for more
information.Compatibilityaiorgwadmin implements all documented Admin API operations or recent versions of
Ceph.  We also implement some of the undocumented ones, too...Installationpip install aiorgwadminLicensergwadmin - a Python interface to the Rados Gateway Admin API
Copyright (C) 2015  UMIACS

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Email:
    github@umiacs.umd.edu
Package: aioriak
Asyncio (PEP 3156) Riak client library.
This project is based on official Basho python client library
(https://github.com/basho/riak-python-client).FeaturesRiak KV operationsYesRiak DatatypesYesRiak BucketTypesYesCustom resolverYesNode list supportWIPCustom quorumNoConnections PoolNoOperations timeoutNoSecurityNoRiak SearchWIPMapReduceWIPTested python versions3.5, 3.6Tested Riak versions2.1.4, 2.2.3DocumentationYou can read the docs here:DocumentationInstallationThe easiest way to install aioriak is by using the package on PyPi:pip install aioriakRequirementsPython >= 3.5riak>=2.7.0Using exampeclient=awaitRiakClient.create('localhost',loop=loop)bucket_type=client.bucket_type('default')bucket=bucket_type.bucket('example')obj=awaitbucket.get('key')print(obj.data)TestingDocker based testingYou can use docker for running:DOCKER_CLUSTER=1pythonsetup.pytestContributeIssue Tracker:https://github.com/rambler-digital-solutions/aioriak/issuesSource Code:https://github.com/rambler-digital-solutions/aioriakFeel free to file an issue or make pull request if you find any bugs or have
some suggestions for library improvement.LicenseThe aioriak is offered underMIT license.
Package: aioring
aioring (Io Rings for asyncio)aioring is a library that handles async fileIO.
Currently we only support io_uring on linux, other operating systems fall back to a custom ring using python threads which is only intended for development purposes and should not be used in production.fromaioringimportaioasyncwithawaitaio.open("file.name","r")asf:content=awaitf.read()installaioring can be installed with pippipinstallaioringaosin aos we expose async versions of functions defined in the 'os' module.
currently we support:aos.pread(fd: int, count: int, offset: int)aos.pwrite(fd: int, buffer: bytes, offset: int)aos.close(fd: int)aos.open(path: str, flags: int, mode: int=0o777, *, dir_fd=None)aos.fstat(fd: int)aos.stat(path: str)these functions should work the same way as their counterpart in the os module but need to be called with await.aioin aio we expose a async implementation of the cpython pyio module (https://github.com/python/cpython/blob/3.10/Lib/_pyio.py)
usage is like normal io but with async/awaitfromaioringimportaio# read fileasyncwithawaitaio.open("file.txt","r")asf:data=awaitf.read()# write fileasyncwithawaitaio.open("file.txt","w")asf:data=awaitf.write("test")PlansfileIOWindows IoRingsocketIOdirectory operations? (io_uring currently does not support readdir)
Package: aiorinnai
aiorinnai - Python interface for the Rinnai Control-R APIPython library for communicating with theRinnai Control-R Water Heaters and control devicesvia the Rinnai Control-R cloud API.WARNINGThis library only works if you have migrated to the Rinnai 2.0 app.  This will require a firmware update to your Control-R module.IOSAndroidNOTE:This library is community supported, please submit changes and improvements.This is a very basic interface, not well thought out at this point, but works for the use cases that initially prompted spitting this out from.Supportsstarting/stop recirculationsetting temperatureInstallationpip install aiorinnai==0.3.0ExamplesimportasynciofromaiohttpimportClientSessionfromaiorinnaiimportasync_get_apiasyncdefmain()->None:"""Run!"""api=awaitasync_get_api("<EMAIL>","<PASSWORD>")# Get user account information:user_info=awaitapi.user.get_info()# Get device informationfirst_device_id=user_info["devices"]["items"][0]["id"]device_info=awaitapi.device.get_info(first_device_id)#Start Recirculation#Last variable is duration in minutesstart_recirculation=awaitapi.device.start_recirculation(device_info['data']['getDevices'],5)#Stop Recirculationstop_recirculation=awaitapi.device.stop_recirculation(device_info['data']['getDevices'])#Set Temperature#Last variable is the temperature in increments of 5set_temperature=awaitapi.device.set_temperature(device_info['data']['getDevices'],130)asyncio.run(main())By default, the library creates a new connection to Rinnai with each coroutine. If you are calling a large number of coroutines (or merely want to squeeze out every second of runtime savings possible), an aiohttp ClientSession can be used for connection pooling:importasynciofromaiohttpimportClientSessionfromaiorinnaiimportasync_get_apiasyncdefmain()->None:"""Create the aiohttp session and run the example."""asyncwithClientSession()aswebsession:api=awaitasync_get_api("<EMAIL>","<PASSWORD>",session=websession)# Get user account information:user_info=awaitapi.user.get_info()# Get device informationfirst_device_id=user_info["devices"]["items"][0]["id"]device_info=awaitapi.device.get_info(first_device_id)#Start Recirculation#Last variable is duration in minutesstart_recirculation=awaitapi.device.start_recirculation(user_info["id"],first_device_id,5)print(start_recirculation)#Stop Recirculationstop_recirculation=awaitapi.device.stop_recirculation(user_info["id"],first_device_id)print(stop_recirculation)#Set Temperature#Last variable is the temperature in increments of 5set_temperature=awaitapi.device.set_temperature(user_info["id"],first_device_id,130)asyncio.run(main())Known Issuesnot all APIs supported
Package: aio-rmq-wss-proxy
Asynchronous RMQ -> Websocket Proxy ServerHere is an implementation of typical websocket server which receives messages from RMQ and process them and send to connected websocket clientsIn the current state WS server is capable of:Running a server instance which accepts websocket connections from clients and control them;connecting to RabbitMQ, creating Exchange and Queue and consume on it;receiving messages from RMQ Queue;processing received RMQ messages and send them to connected websocket clients.StructPippip install aio-rmq-wss-proxySourceClone repositoryRun "cd aio_rmq_wss_proxy/"Run "make install"Run the commands "make run_server" & "make run_client" to see how does it worksPlease, note that before running server and client you need to have installed and running Rabbit MQ broker.This is how it works from the box.CustomizationYou can see the "public_sample" in "_testing/public_sample" directory and use it for build your own proxy server
Package: aiornot
AIORNOT Python ClientThis is a Python client for theAIORNOTAPI.Getting StartedAccount Registration and API Key GenerationRegister for an account atAIORNOT. After creating an account,
you can generate an API key via yourdashboard. If you
just created your account, the page looks like,Click theRequest API Keybutton to generate a new API key. After generating a key, the page
looks like,Press theCopy API Keybutton to copy the key to your clipboard. If you already have
generated an API key, the page looks like,Press theRefresh API Keybutton to generate a new API key. Then press theCopy API Keybutton
to copy the key to your clipboard.[!WARNING]Never share your API key with anyone. It is like a password.Installing the Python PackageTo install the python package, run the following command,pipinstallaiornotUsing the client requires an API key. You can set the API key in two ways.The easier and more flexible way is to set an environment variable,AIORNOT_API_KEY=your_api_keyOtherwise, you can pass the api key in as an argument to the client,fromaiornotimportClient,AsyncClientclient=Client(api_key='your_api_key')# sync clientasync_client=AsyncClient(api_key='your_api_key')# async clientFailure to set either the environment variable or the api key argument will result in a runtime error.View from 10,000 feetfromaiornotimportClient# Create a client (reads AIORNOT_API_KEY env)client=Client()# Classify an image by urlresp=client.image_report_by_url('https://thispersondoesnotexist.com')# Classify an image by pathresp=client.image_report_by_file('path/to/image.jpg')# Classify audio by urlresp=client.audio_report_by_url('https://www.youtube.com/watch?v=v4WiI4es_UI')# Classify audio by pathresp=client.audio_report_by_file('path/to/audio.mp3')# Check your tokenresp=client.check_token()# Refresh your tokenresp=client.refresh_token()# Revoke your tokenresp=client.revoke_token()# Check if the API is upresp=client.is_live()There is also an async client that has the same methods as the sync client, but as coroutines.importasynciofromaiornotimportAsyncClientasyncdefmain():client=AsyncClient()ifawaitclient.check_api():print('API is up!')else:print('API is down :(')if__name__=='__main__':asyncio.run(main())CLI UsageAIOrNot also comes with a CLI. You can use it easily via apipxinstallation,# For fresh installpipxinstallaiornot# For upgradepipxupgradeaiornotThe CLI also looks for theAIORNOT_API_KEYenvironment variable. But it will also
look for a~/.aiornot/config.jsonfile if the environment variable is not set. To
set it up, run the following command,aiornottokenconfigand follow the prompts. Afterwards, you can see a menu of commands with,aionotthe two most useful ones being,# Classify an image by url or pathaiornotimage[url|path]# Classify audio by url or pathaionotaudio[text]
Package: aiorobinhood
aiorobinhoodThin asynchronous wrapper for the unofficial Robinhood API.Why?Supports automated trading strategies on RobinhoodSupports concurrency using asynchronous programming techniquesGetting StartedimportasyncioimportosfromaiorobinhoodimportRobinhoodClientusername=os.getenv("ROBINHOOD_USERNAME")password=os.getenv("ROBINHOOD_PASSWORD")asyncdefmain():asyncwithRobinhoodClient(timeout=1)asclient:awaitclient.login(username,password)# Buy $10.50 worth of Appleawaitclient.place_market_buy_order("AAPL",amount=10.5)# End sessionawaitclient.logout()if__name__=="__main__":asyncio.run(main())DependenciesPython 3.7+aiohttpyarlLicenseaiorobinhoodis offered under the MIT license.
Package: aiorobonect
aiorobonectAsynchronous library to communicate with the Robonect APIAPI Example"""Test for aiorobonect."""fromaiorobonectimportRobonectClientimportasyncioimportjsonimportaiohttpasyncdefmain():host="10.0.0.99"## The Robonect mower IPusername="USERNAME"## Your Robonect usernamepassword="xxxxxxxx"## Your Robonect passwordtracking=[## Commands to query"battery","wlan","version","timer","hour","error"]client=RobonectClient(host,username,password)try:status=awaitclient.async_cmd("status")print(status)tracking=awaitclient.async_cmds(tracking)print(json.dumps(tracking,indent=2))exceptExceptionasexception:ifisinstance(exception,aiohttp.ClientResponseError):print(exception)awaitclient.session_close()asyncio.run(main())
Package: aiorobot
Root robotPython async API for iRobot Root (coding robot) over bluetooth-low-energy protocol.Protocol specifications fromhttps://github.com/RootRobotics/root-robot-ble-protocol.InstallationInstall theaiorobotpackage from PyPI withpip.pipinstallaiorobotQuickstartTo simply run the robot, use therunfunction ofaiorobotmodule.
It takes coroutine callbacks for different root robot events.fromaiorobotimportrunasyncdefmain(robot):foriinrange(4):awaitrobot.led.on((0,i*80,100))awaitrobot.motor.drive(150)awaitrobot.motor.rotate(900)awaitrobot.disconnect()run(started=main)This will search for a root robot in bluetooth devices, connect to it and call themaincoroutine when the root is ready.
So make sure you have bluetooth enabled and working on your computer.Accepted keyword-arguments ofrunfunction are event names listed inaiorobot/events.py.You can also directly get a robot and interact with it withget_robotfunction that you can use as an async context-manager to start the connection.importasynciofromaiorobotimportget_robotasyncdefmain():asyncwithget_robot()asrobot:awaitrobot.motor.drive(150)asyncio.run(main())Then you will need to handle events yourself (iterate overrobot.eventsor callrobots.events.process()) to get updates from the robot.See more code examples inaiorobot/examplesdirectory.
Package: aiorocket
SDK для работы с TON Rocket🔐 АвторизацияКак получить токен написанотут.Mainnet:importaiorocketapi=aiorocket.Rocket('токен')Testnet:importaiorocketapi=aiorocket.Rocket('токен',testnet=True)🚀 МетодыПолучение информации о приложенииДокументацияПример:awaitapi.info()ПереводВсе параметры как вдокументацииПример:awaitapi.send(tgUserId=1448705322,currency="TONCOIN",amount=0.123,description="Всем совятам привет!")ВыводВсе параметры как вдокументацииПример:awaitapi.withdraw(address="EQAJkw0RC9s_FAEmKr4GftJsNbA0IK0o4cfEH3bNoSbKJHAy",currency="TONCOIN",amount=0.123,comment="Всем совятам привет!")Создание чекаВсе параметры как вдокументацииПример:cheque=awaitapi.create_cheque({chequePerUser=0.005,usersNumber=100,refProgram=50,password="пароль :D",description="Чек для вас",sendNotifications=True,enableCaptcha=True,telegramResourcesIds=["-1001799549067"]})Получение чековДокументацияПример:awaitapi.get_cheques()Получение чека по IDВсе параметры как вдокументацииПример:awaitapi.get_cheque(1234)Удаление чекаВсе параметры как вдокументацииПример:awaitapi.delete_cheque(1234)# ИЛИ ТАКawaitcheque.delete()# в стиле ООПСоздание счётаВсе параметры как вдокументацииПример:invoice=awaitapi.createInvoice(amount=1.23,description="покупка лучшой вещи в мире",hiddenMessage="спасибо",callbackUrl="https://t.me/ton_rocket",payload="some payload",expiredIn=10)Получение счетовДокументацияПример:awaitapi.get_invoices()Получение счёта по IDВсе параметры как вдокументацииПример:awaitapi.get_invoice(1234)Удаление счётаВсе параметры как вдокументацииПример:awaitapi.delete_invoice(1234)# ИЛИ ТАКawaitinvoice.delete()# в стиле ООПДоступные валютыДокументацияПример:awaitapi.available_currencies()⚠ Обработка ошибокtry:api.get_invoice(1234)# вызов методаexceptaiorocket.classes.RocketAPIErroraserr:print(err.errors)Результат:{"property":"somePropertyName","error":"somePropertyName should be less than X"}
Package: aioroku
Screw remotes. Control yourRokuvia Python. Asynchronously.Installationpip install aiorokuUsageRequires Python 3.5 and uses asyncio and aiohttp.import asyncio
 import aiohttp
 from aioroku import AioRoku

def get_args():
    arg_parser = ArgumentParser()
    arg_parser.add_argument('--roku_ip', '-r', metavar="ROKU_IP_ADDRESS")
    args = arg_parser.parse_args()
    return args.roku_ip

 async def main():
     async with aiohttp.ClientSession() as session:
         my_roku = AioRoku(host, session)
         print(await my_roku.active_app)

 if __name__ == '__main__':
     roku_ip = get_args()
     loop = asyncio.get_event_loop()
     loop.run_until_complete(main(roku_ip))
     loop.close()TODODocsTests, of course.
Package: aio-rom
Python Redis Object Mapperasyncio based Redis object mapperTable of contentInstallationUsageFeaturesTODOLimitationsInstallationTODOUsageimportasynciofromdataclassesimportfieldfromtypingimportSet,Dictfromaio_romimportModelfromaio_rom.fieldsimportMetadatafromaio_rom.sessionimportredis_poolclassFoo(Model):bar:intfoobar:Set[int]=field(default_factory=set)my_boolean:bool=Falsetransient_field:Dict=field(metadata=Metadata(transient=True))classOtherFoo(Model):foo:Fooasyncdefmain():asyncwithredis_pool("redis://localhost"):foo=Foo(123,{1,2,3},True)awaitfoo.save()...foo2=awaitFoo.get(321)other_foo=OtherFoo(303,foo2)awaitother_foo.save()asyncio.run(main())FeaturesTODOTODODocsTestsLimitationsconfiguremust be called before other calls to Redis can succeed, no defaults to localhost atm.You cannot usefrom __future__ import annotationsin the same file you define your models. Seehttps://bugs.python.org/issue39442TODO Supported datatypesProbably more ...
Package: aiorosapi
aiorosapiSimple asyncio-based library to perform API queries on
Mikrotik RouterOS-based devices.InstallationInstall from PyPi:pip install aiorosapiInstall from sources:git clone https://github.com/gaussgss/aiorosapi.git
cd aiorosapi
python setup.py installUsageimport asyncio
from aiorosapi.protocol import create_ros_connection


async def main():
    conn = await create_ros_connection(
        host='192.168.90.1',
        port=8728,
        username='admin',
        password=''
    )

    data = await conn.talk_one('/system/routerboard/print')
    print("Routerboard info:")
    for k, v in data.items():
        print('{:>20s}: {}'.format(k, v))

    data = await conn.talk_all('/interface/ethernet/print')
    print("Ethernet interfaces:")
    for item in data:
        print("{:>20s}: {}".format(item['.id'], item['name']))

    await conn.disconnect()
    await conn.wait_disconnect()



if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()
Package: aiorpc
aiorpc is a lightweight asynchronous RPC library. It enables you to easily build a distributed server-side system by writing a small amount of code. It is built on top ofasyncioandMessagePack.Note aiorpc is under development, should not be considered to have a stable API.InstallationTo install aiorpc, simply:$pipinstallaiorpcExamplesRPC serverfromaiorpcimportRPCServerimportasyncioimportuvloopdefecho(msg):returnmsgrpc_server=RPCServer()loop=uvloop.new_event_loop()asyncio.set_event_loop(loop)rpc_server.register("echo",echo)coro=asyncio.start_server(rpc_server.serve,'127.0.0.1',6000,loop=loop)server=loop.run_until_complete(coro)try:loop.run_forever()exceptKeyboardInterrupt:server.close()loop.run_until_complete(server.wait_closed())RPC clientfromaiorpcimportRPCClientimportasyncioimportuvloopasyncdefdo(cli):ret=awaitclient.call('echo','message')print("{}\n".format(ret))loop=uvloop.new_event_loop()asyncio.set_event_loop(loop)client=RPCClient('127.0.0.1',6000)loop.run_until_complete(do(client))client.close()aiorpc client can also be used as an async context manager:asyncdefdo():asyncwithRPCClient('127.0.0.1',6000)asclient:ret=awaitclient.call('echo','message')print("{}\n".format(ret))Performanceaiorpc withuvloopsignificantly outperformsZeroRPC(6xfaster), which is built usingZeroMQandMessagePackand slightly underperformsofficial MessagePack RPC(0.7xslower), which is built usingFacebook’s TornadoandMessagePack.aiorpc%pythonbenchmarks/benchmark_aiorpc.pycall:2236qpsOfficial MesssagePack RPC%pipinstallmsgpack-rpc-python%pythonbenchmarks/benchmark_msgpackrpc.pycall:3112qpsZeroRPC%pipinstallzerorpc%pythonbenchmarks/benchmark_zerorpc.pycall:351qpsDocumentationDocumentation is available athttp://aiorpc.readthedocs.org/.
Package: aiorq
AiorqIntroductionAiorq is a distributed task queue with asyncio and redis, which rewrite from arq to make improvement and include web
interface.Seedocumentationfor more details.Requirementsredis >= 5.0aioredis >= 2.0.0InstallpipinstallaiorqQuick StartTask Definition# demo.py# -*- coding: utf-8 -*-importasyncioimportosfromaiorq.connectionsimportRedisSettingsfromaiorq.cronimportcronasyncdefsay_hello(ctx,name)->None:awaitasyncio.sleep(5)print(f"Hello{name}")asyncdefstartup(ctx):print("starting... done")asyncdefshutdown(ctx):print("ending... done")asyncdefrun_cron(ctx,name_):returnf"hello{name_}"classWorkerSettings:redis_settings=RedisSettings(host=os.getenv("REDIS_HOST","127.0.0.1"),port=os.getenv("REDIS_PORT",6379),database=os.getenv("REDIS_DATABASE",0),password=os.getenv("REDIS_PASSWORD",None))functions=[say_hello]on_startup=startupon_shutdown=shutdowncron_jobs=[cron(coroutine=run_cron,kwargs={"name_":"pai"},hour={17,12,18},minute=40,second=50,keep_result_forever=True)]Run aiorq worker> aiorq tasks.WorkerSettings worker
15:08:50: Starting Queue: ohuo
15:08:50: Starting Worker: ohuo@04dce85c-1798-43eb-89d8-7c6d78919feb
15:08:50: Starting Functions: say_hello, EnHeng
15:08:50: redis_version=5.0.10 mem_usage=731.12K clients_connected=2 db_keys=9
starting...Integration in FastAPI> aiorq tasks.WorkerSettings server
INFO:     Started server process [4524]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)DashboardSeedashboardfor more details.ThanksArqandFastAPILicenseMIT
Package: aiorsmq
aiorsmqThis is the repository for aiorsmq (AsyncIORSMQ), an asynchronous (async/await) implementation ofRSMQfor Python 3.6+. It aims to provide all the features that RSMQ provides, but for Python users.FeaturesSome of aiorsmq's features are:Fully compatible with RSMQ.Provides an API similar to that of RSMQ, with some changes done to achieve something more "pythonic".All public functions, methods and classes documented.Type-annotated and checked withmypy.Tested against Redis, and against the original RSMQ library.InstallationTo install aiorsmq, run:$pipinstallaiorsmqDocumentationFor examples and API documentation please visit thedocumentation pages.Related ProjectsFor a synchronous implementation of RSMQ for Python, seePyRSMQ.LicenseDistributed under the MIT license.SeeLICENSEfor more details.
Package: aiorss
aiorssAsyncio client for interacting with rss feedsInstallation instructions:pipinstallaiorssUsage:fromaiorssimportRSSFeedasyncdefmain():url='http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'feed=RSSFeed(url)returnawaitfeed.parse()Noteaiorss is not affiliated or endorsed by any of the web services it interacts with.