Saravanan666/pypi-org huggingface dataset:
Package: aiosfstream
aiosfstreamaiosfstream is aSalesforce Streaming APIclient forasyncio. It can
be used to receive push notifications about changes on Salesforce objects or
notifications of general events sent through theStreaming API.For detailed guidance on how to work withPushTopicsor how
to createGeneric Streaming Channelsplease consult theStreaming API documentation.
For working withPlatform EventsorChange Data Capture eventscheck out the linked
documentation.FeaturesSupported authentication types:using a username and passwordusing a refresh tokenSubscribe to and receive messages on:PushTopicsGeneric Streaming ChannelsPlatform EventsChange Data Capture eventsSupport fordurable messages and replay of eventsAutomatic recovery from replay errorsUsageimportasynciofromaiosfstreamimportSalesforceStreamingClientasyncdefstream_events():# connect to Streaming APIasyncwithSalesforceStreamingClient(consumer_key="<consumer key>",consumer_secret="<consumer secret>",username="<username>",password="<password>")asclient:# subscribe to topicsawaitclient.subscribe("/topic/one")awaitclient.subscribe("/topic/two")# listen for incoming messagesasyncformessageinclient:topic=message["channel"]data=message["data"]print(f"{topic}:{data}")if__name__=="__main__":loop=asyncio.get_event_loop()loop.run_until_complete(stream_events())Documentationhttp://aiosfstream.readthedocs.io/Changelog0.5.0 (2019-03-08)Add support for Change Data Capture eventsFix some typos in the documentation0.4.0 (2019-01-06)Add type hintsConfigurable replay storage behavior0.3.0 (2018-11-07)Add support for sandbox orgs0.2.5 (2018-11-06)Add missing changelog entries0.2.4 (2018-11-06)Fix platform event message creation date extraction issue0.2.3 (2018-09-19)Fix asynchronous iterator bug in python 3.70.2.2 (2018-06-15)Update aiocometd dependency to 0.3.10.2.1 (2018-05-25)Fix replay issues on mass record delete operationsImprove the documentation of the Client.publish method0.2.0 (2018-05-05)Enable the usage of third party JSON librariesExpose authentication results as public attributes in Authenticator classes0.1.0 (2018-04-26)Supported authentication types:using a username and passwordusing a refresh tokenSubscribe to and receive messages on:PushTopicsGeneric Streaming ChannelsSupport fordurable messages and replay of eventsAutomatic recovery from replay errors
Package: aio-sf-streaming
aio-sf-streamingaio-sf-streamingis a simple Python 3.6 asyncio library allowing to connect
and receive live notifications from Salesforce. This library is provided to
you bypapernest.SeeThe Force.com streaming API developer guidefor more information about the different uses cases and how configure your
Salesforce organization.Featureasynciocompatible libraryAuthentication with username/password or refresh tokenSubscribe to push topics and custom eventsReceive events pushed by SalesforceAuto-reconnect after too many time of inactivityReplay support: replay events missed while your client is disconnected (seeForce.com documentationfor more information).aio-sf-streamingonly support Python 3.6.Getting startedSimple use case:importasynciofromaio_sf_streamingimportSimpleSalesforceStreamingasyncdefprint_event():# Create client and connectasyncwithSimpleSalesforceStreaming(username='my-username',password='my-password',client_id='my-client-id',client_secret='my-client-secret')asclient:# Subscribe to some push topicsawaitclient.subscribe('/topic/Foo')awaitclient.subscribe('/topic/Bar')asyncformessageinclient.events():print(message)# client will wait indefinitely, you can ask to exitifmessage['channel']=='/topic/Bar':breakelse:# You can unsubscribe when you want, tooawaitclient.unsubscribe('/topic/Foo')loop=asyncio.get_event_loop()loop.run_until_complete(print_event())InstallationSimply usepip:$pipinstallaio-sf-streamingDocumentationAnonline documentation is available.EvolutionThe library work well for our use-case then we does not plan a lot of new
features.ContributingIf you find any problem, feel free to fill an issue. Pull-Request are also
welcomed.You can install development dependencies with:$pipinstall-e.[tests,docs]Release historyv. 0.3.0: Remove date-time parsing of the replay mixin, allow client to
customizeReSubscribeMixinretry conditions, allow retry conditions to
extend duration.v. 0.2.0: Add refresh token authenticationv. 0.1.1: Add documentation and initial typing information.v. 0.1.0: Initial release.Licenseaio-sf-streamingis offered under the MIT license.
Package: aiosfstream-ng
aiosfstreamaiosfstream is aSalesforce Streaming APIclient forasyncio. It can
be used to receive push notifications about changes on Salesforce objects or
notifications of general events sent through theStreaming API.For detailed guidance on how to work withPushTopicsor how
to createGeneric Streaming Channelsplease consult theStreaming API documentation.
For working withPlatform EventsorChange Data Capture eventscheck out the linked
documentation.FeaturesSupported authentication types:using a username and passwordusing a refresh tokenSubscribe to and receive messages on:PushTopicsGeneric Streaming ChannelsPlatform EventsChange Data Capture eventsSupport fordurable messages and replay of eventsAutomatic recovery from replay errorsUsageimportasynciofromaiosfstreamimportSalesforceStreamingClientasyncdefstream_events():# connect to Streaming APIasyncwithSalesforceStreamingClient(consumer_key="<consumer key>",consumer_secret="<consumer secret>",username="<username>",password="<password>")asclient:# subscribe to topicsawaitclient.subscribe("/topic/one")awaitclient.subscribe("/topic/two")# listen for incoming messagesasyncformessageinclient:topic=message["channel"]data=message["data"]print(f"{topic}:{data}")if__name__=="__main__":loop=asyncio.get_event_loop()loop.run_until_complete(stream_events())Documentationhttp://aiosfstream.readthedocs.io/Changelog0.5.0 (2019-03-08)Add support for Change Data Capture eventsFix some typos in the documentation0.4.0 (2019-01-06)Add type hintsConfigurable replay storage behavior0.3.0 (2018-11-07)Add support for sandbox orgs0.2.5 (2018-11-06)Add missing changelog entries0.2.4 (2018-11-06)Fix platform event message creation date extraction issue0.2.3 (2018-09-19)Fix asynchronous iterator bug in python 3.70.2.2 (2018-06-15)Update aiocometd dependency to 0.3.10.2.1 (2018-05-25)Fix replay issues on mass record delete operationsImprove the documentation of the Client.publish method0.2.0 (2018-05-05)Enable the usage of third party JSON librariesExpose authentication results as public attributes in Authenticator classes0.1.0 (2018-04-26)Supported authentication types:using a username and passwordusing a refresh tokenSubscribe to and receive messages on:PushTopicsGeneric Streaming ChannelsSupport fordurable messages and replay of eventsAutomatic recovery from replay errors
Package: aiosftp
aioSFTPaioSFTP is a FTP/sFTP/SSH server implemented on top of asyncio with integrated security, TLS/SSL connections, Users and other cool features.
work withasyncio.aioSFTPrequires Python 3.8+ and is distributed under Apache 2 license.Which services are providedFTP Server (using aioftp)sFTP server and SSH Server (using asyncssh)Web interface for uploading files (using aiohttp)How do I get set up?First, you need to install aioSFTP:.. code-block ::pip install aiosftpThen, you can start the server running the command:.. code-block ::aiosftp --host  --portwhere<hostname>is a hostname of the server (default, listen on localhost)<port>SSH Server Port<ftp-port>FTP Server Port<path>The base path where all files live in.LicenseaioSFTP is copyright of Jesus Lara (https://phenobarbital.info) and is under Apache 2 license. I am providing code in this repository under an open source license, remember, this is my personal repository; the license that you receive is from me and not from my employeer.
Package: aioshadowsocks
aioshadowsocks用 asyncio 重写 shadowsocks视频安装教程面板视频安装教程:地址后端对接视频教程:地址隧道对接视频教程:地址使用安装pipinstallaioshadowsocks多用户配置aioshadowsocks 将json作为配置文件, 会读取当前目录下userconfigs.json作为默认的配置文件{"users":[{"user_id":1,"port":2345,"method":"none","password":"hellotheworld1","transfer":104857600,"speed_limit":0},{"user_id":2,"port":2346,"method":"chacha20-ietf-poly1305","password":"hellotheworld2","transfer":104857600,"speed_limit":384000}]}同时也支持从http服务器读取配置文件，这时需要注入环境变量SS_API_ENDPOINT作为读取配置的api地址注入环境变量export SS_API_ENDPOINT="https://xxx/com"启动ss服务器aiossrun_ss_serverDocker Versioninstall dockercurl-sSLhttps://get.docker.com/|shinstall docker-composesudocurl-L"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-composeapply executable permissionssudochmod+x/usr/local/bin/docker-composerun serverdocker-composeup为什么要重写shadowsocks主要想通过这个项目的推进来深入了解asyncio另外我的一个项目:django-sspanel依赖shadowsocksr但该项目已经停止开发了，所以决定重新造个轮子主要功能tcp/udp 代理流量统计速率控制开放了grpc接口(类似ss-manager)单端口多用户（利用AEAD加密在不破坏协议的情况下实现）prometheus/grafana metrics监控（dashboard在项目的static/grafana/文件夹下）监控dashboard性能测试Shadowsocks本身是一个IO密集行的应用，但是由于加入了AEAD加密，使得SS本身变成了CPU密集行的应用
而Python本身是不太适合CPU密集的场景的，所以在AEAD模式中的表现不佳
PS: 当然，其实是我代码写的烂，python不背锅Steam-Cipher-None(不加密 高IO)AEAD-Cipher-CHACHA-20(加密 高CPU)rpc protosyntax="proto3";packageaioshadowsocks;// REQmessageUserIdReq{int32user_id=1;}messagePortReq{int32port=1;}messageUserReq{int32user_id=1;int32port=2;stringmethod=3;stringpassword=4;boolenable=5;}// RESmessageEmpty{}messageUser{int32user_id=1;int32port=2;stringmethod=3;stringpassword=4;boolenable=5;int32speed_limit=6;int32access_order=7;boolneed_sync=8;repeatedstringip_list=9;int32tcp_conn_num=10;int64upload_traffic=11;int64download_traffic=12;}// serviceservicess{rpcCreateUser(UserReq)returns(User){}rpcUpdateUser(UserReq)returns(User){}rpcGetUser(UserIdReq)returns(User){}rpcDeleteUser(UserIdReq)returns(Empty){}}
Package: aioshell
Run single-threaded concurrent shell and SSH commands with few keystrokes.fromaioshellimportExecutor,Shellexe=Executor()exe.add(Shell('date >/tmp/aioshell; sleep 1'))exe.add(Shell('sleep 1; date >>/tmp/aioshell'))exe.finish()# Check /tmp/aioshell file to see that only 1 sec has passed.For more details, please,Read the Docs.
Package: aioshelly
AioshellyAsynchronous library to control Shelly devicesThis library is under developmentRequirementsPython >= 3.10bluetooth-data-toolsaiohttporjsonInstallpipinstallaioshellyInstall from SourceRun the following command inside this folderpipinstall--upgrade.ExamplesGen1 Device (Block/CoAP) example:importasynciofrompprintimportpprintimportaiohttpfromaioshelly.block_deviceimportCOAP,BlockDevicefromaioshelly.commonimportConnectionOptionsfromaioshelly.exceptionsimport(DeviceConnectionError,FirmwareUnsupported,InvalidAuthError,)asyncdeftest_block_device():"""Test Gen1 Block (CoAP) based device."""options=ConnectionOptions("192.168.1.165","username","password")asyncwithaiohttp.ClientSession()asaiohttp_session,COAP()ascoap_context:try:device=awaitBlockDevice.create(aiohttp_session,coap_context,options)exceptFirmwareUnsupportedaserr:print(f"Device firmware not supported, error:{repr(err)}")returnexceptInvalidAuthErroraserr:print(f"Invalid or missing authorization, error:{repr(err)}")returnexceptDeviceConnectionErroraserr:print(f"Error connecting to{options.ip_address}, error:{repr(err)}")returnforblockindevice.blocks:print(block)pprint(block.current_values())print()if__name__=="__main__":asyncio.run(test_block_device())Gen2 and Gen3 (RPC/WebSocket) device example:importasynciofrompprintimportpprintimportaiohttpfromaioshelly.commonimportConnectionOptionsfromaioshelly.exceptionsimport(DeviceConnectionError,FirmwareUnsupported,InvalidAuthError,)fromaioshelly.rpc_deviceimportRpcDevice,WsServerasyncdeftest_rpc_device():"""Test Gen2/Gen3 RPC (WebSocket) based device."""options=ConnectionOptions("192.168.1.188","username","password")ws_context=WsServer()awaitws_context.initialize(8123)asyncwithaiohttp.ClientSession()asaiohttp_session:try:device=awaitRpcDevice.create(aiohttp_session,ws_context,options)exceptFirmwareUnsupportedaserr:print(f"Device firmware not supported, error:{repr(err)}")returnexceptInvalidAuthErroraserr:print(f"Invalid or missing authorization, error:{repr(err)}")returnexceptDeviceConnectionErroraserr:print(f"Error connecting to{options.ip_address}, error:{repr(err)}")returnpprint(device.status)if__name__=="__main__":asyncio.run(test_rpc_device())Example scriptThe repository includes example script to quickly try it out.Connect to a device and print its status whenever we receive a state change:python3 tools/example.py -ip <ip> [-u <username>] [-p <password] -iConnect to all the devices indevices.jsonat once and print their status:python3 tools/example.py -d -iShow usage help:python3 tools/example.py -hContribution guidelinesObject hierarchy and property/method names should match theShelly API.
Package: aioshim
# aioshim## DescriptionThe main purpose of this lib is to provide *asyncio* compatible versions of the functions in the standard library. E.g. `itertools.chain()` doesn't work with `async_generators`, so there is `aioshim.itertools.chain()` to fill the gap. Etc.I'm sure the stdlib will catch up with this sooner or later. This lib is for those who need a shim as soon as possible.This could be a central repo for all such *asyncio* related shims.If there is interest, this repo could be maintained by a github *aioshim* org or something.## Requirementsaioshim requires Python `>= 3.6`## Installpip install aioshimorpipenv install aioshim## DevelopmentJust clone the repo and run:pipenv install --devThis project uses [yapf](https://github.com/google/yapf) formatter.<br/># Library Documentation* [builtins](#builtins)* [aenumerate](#aenumerate)* [itertools](#itertools)* [chain](#itertoolschainiterables)* [chain_from_iterable](#itertoolschain_from_iterableiterable)## builtins### `aenumerate`Async version of: [enumerate](https://docs.python.org/3.6/library/functions.html#enumerate)Example:```pythonasync for i in aenumerate(chain(a_gen, range(10))):print(i)```## itertools### `itertools.chain(*iterables)`Async version of: [itertools.chain](https://docs.python.org/3.6/library/itertools.html#itertools.chain)This function can handle `AsyncGeneratorType`.Example:```python# Use with async_generator:async for i in chain(my_async_gen1, my_async_gen2):print(i)# Allows for mixing normal generators with async generators:async for i in chain(my_async_gen, range(10)):print(i)```### `itertools.chain_from_iterable(iterable)`Async version of: [itertools.chain.from_iterable](https://docs.python.org/3.6/library/itertools.html#itertools.chain.from_iterable)This function can handle `AsyncGeneratorType`.Example:```python# Use with async_generator:async for i in chain_from_iterable(my_async_generator):print(i)# Works with normal items as well:async for i in chain_from_iterable([range(10)]):print(i)tertoolschain_from_iterableiterable```## More items to comePull requests appreciated!
Package: aioshutdown
aioshutdownContext manager that provides simple graceful shutdown interface for your asyncio tasks.Installationpip install -U aioshutdownUsageJust specify the list of signals that you want to intercept using the|operator:fromaioshutdownimportSIGTERM,SIGINT,SIGHUPwithSIGTERM|SIGHUP|SIGINTasloop:...The context manager will return an instance of the current event loop. You can intercept signals directly inside your coroutines:asyncdefmy_task(sleep:int):try:""" Main logic of your coroutine. """exceptasyncio.CancelledErrorasexc:""" In this place you can gracefully complete the work. """Full example:importasynciofromaioshutdownimportSIGTERM,SIGINT,SIGHUPimportlogginglogging.basicConfig(level=logging.INFO,format="%(asctime)s,%(msecs)d%(levelname)s:%(message)s",datefmt="%H:%M:%S",)asyncdefmy_task(sleep:int):try:whileTrue:logging.info("Sleep from task #%s",sleep)awaitasyncio.sleep(sleep)exceptasyncio.CancelledErrorasexc:# Received an exit signal. In this place we gracefully complete the work.signal=exc.args[0]# NOTE: works in Python >= 3.9 only: https://docs.python.org/3/library/asyncio-future.html?highlight=Changed%20in%20version%203.9:%20Added%20the%20msg%20parameter.#asyncio.Future.cancellogging.warning("Received%ssignal. Shutting down...",signal.value)# Usage with `run_forever`withSIGTERM|SIGHUP|SIGINTasloop:tasks=[loop.create_task(my_task(i))foriinrange(1,10)]loop.run_forever()# Usage with `run_until_complete`withSIGTERM|SIGHUP|SIGINTasloop:tasks=[loop.create_task(my_task(i))foriinrange(1,10)]loop.run_until_complete(asyncio.gather(*results))Output23:04:05,798 INFO: Sleep from task #1
23:04:05,798 INFO: Sleep from task #2
23:04:06,799 INFO: Sleep from task #1
23:04:07,800 INFO: Sleep from task #2
23:04:07,800 INFO: Sleep from task #1
23:04:08,801 INFO: Sleep from task #1
^C23:04:09,504 INFO: Received exit signal SIGINT...
23:04:09,504 INFO: Cancelling 2 outstanding tasks
23:04:09,504 WARNING: Received 2 signal. Shutting down...
23:04:09,504 WARNING: Received 2 signal. Shutting down...
23:04:09,504 INFO: Stopping event loopUseful linksGraceful Shutdowns with asyncio
Package: aioshutil
aioshutil: Asynchronous shutil module.Introductionaioshutilis a Python library which provides asynchronous version of function of shutil module.shutilmodule is blocking and using it in asyncio applications will block the event loop and slow down the application,aioshutilprovides asynchronous friendly versions of the functions of theshutilmodule as it performs blocking io in a thread pool.Installation$pipinstallaioshutilUsageThe API ofaioshutilmodule is same asshutilmodule except that it is asynchronous.fromaioshutilimportrmtreeawaitrmtree("/tmp")aioshutilprovides the following functions:copyfileobjcopyfilecopymodecopystatcopycopy2copytreemovermtreemake_archiveget_archive_formatsregister_archive_formatunregister_archive_formatget_unpack_formatsregister_unpack_formatunregister_unpack_formatunpack_archiveignore_patternschownwhichget_terminal_sizeaioshutilprovides the following exceptions for consistency withshutilmodule:ErrorSpecialFileErrorExecErrorSameFileError
Package: aiosiduck
aiosiduckA simple QUIC request clientInstallationpip3 install aiosiduckExampleimport asyncio
from aiosiduck import SiduckClient

async def main():
    client = SiduckClient("127.0.0.1", "8088", "cert.pem")
    res = await client.request(b"i am a cat")
    print(res)
    res = await client.request(b"i am a dog")
    print(res)
    await client.close()

if __name__ == "__main__":
asyncio.run(main())
Package: aiosignal
IntroductionA project to manage callbacks inasyncioprojects.Signalis a list of registered asynchronous callbacks.The signal’s life-cycle has two stages: after creation its content
could be filled by using standard list operations:sig.append()etc.After you callsig.freeze()the signal isfrozen: adding, removing
and dropping callbacks is forbidden.The only available operation is calling the previously registered
callbacks by usingawait sig.send(data).For concrete usage examples see theSignals
<https://docs.aiohttp.org/en/stable/web_advanced.html#aiohttp-web-signals>
section of the `Web Server Advanced
<https://docs.aiohttp.org/en/stable/web_advanced.html>chapter of theaiohttp
documentation.Installation$ pip install aiosignalThe library requires Python 3.6 or newer.Documentationhttps://aiosignal.readthedocs.io/Communication channelsgitter chathttps://gitter.im/aio-libs/LobbyRequirementsPython >= 3.6frozenlist >= 1.0.0Licenseaiosignalis offered under the Apache 2 license.Source codeThe project is hosted onGitHubPlease file an issue in thebug trackerif you have found a bug
or have some suggestions to improve the library.
Package: aiosignald
Signald python bindingsInteract with the signal messaging network in python with sweet, sweet autocompletion.Most of the code is generated by thegenerate.pyscript that
uses the schema available athttps://signald.org/protocol.json.No 3rd party dep, just the python standard lib.Installpip install aiosignaldHave signald running. Seetheir
docsabout it.Issue tracker:https://todo.sr.ht/~nicoco/aiosignaldPart of theslidge project(but can be used independently)UsageExample: echo botimportasynciofromaiosignaldimportSignaldAPIimportaiosignald.generatedasapiclassEchoBot(SignaldAPI):asyncdefhandle_IncomingMessage(self,msg:api.IncomingMessagev1,_payload):# hook to the incoming event by naming you function handle_EventName# most stuff comes through an IncomingMessage anywayprint("Received: ",msg)if(data_msg:=msg.data_message)and(body:=data_msg.body):awaitself.send(username=PHONE_NUMBER,recipientAddress=msg.source,messageBody=body)asyncdefmain():loop=asyncio.get_running_loop()_,signald=awaitloop.create_unix_connection(EchoBot,path=SIGNALD_SOCKET_PATH)ifACCOUNT_TYPE=="primary":awaitsignald.register(account=PHONE_NUMBER)# Some async code to get the SMS codecode=awaituser_input("Enter your sms code?")awaitsignald.verify(account=PHONE_NUMBER,code=code)else:# linking to an existing account is also possibleresp=awaitsignald.generate_linking_uri()print("Make this a QR code and scan it on your primary signal device:",resp.uri)awaitsignald.finish_link(device_name="friendly-device-name",session_id=resp.session_id)awaitsignald.on_con_lost# See https://signald.org/articles/protocol/ for more info about thisSIGNALD_SOCKET_PATH="/var/run/signald/signald.sock"PHONE_NUMBER="+XXXXXX"ACCOUNT_TYPE="primary"asyncio.run(main())Docs are available onreadthedocs.
Package: aiosignalrcore
SignalR core client (async fork)This is asyncio version of the original SignalR Corelibrary.The main difference is thatwebsocketlibrary is replaced with asyncio-compatabilewebsockets.All future changes in the original repo will be merged to this fork inheriting the major and minor version number.Installationpip install aiosignalrcoreUsageCheck out thedocsof the original library.The names of all modules, classes, and methods are preserved.Async exampleimportasyncioimportloggingfromaiosignalrcore.hub_connection_builderimportHubConnectionBuilderfromaiosignalrcore.messages.completion_messageimportCompletionMessagefromaiosignalrcore.transport.websockets.connectionimportConnectionStatehub_connection=(HubConnectionBuilder().with_url('%URL%').with_automatic_reconnect({"type":"raw","keep_alive_interval":10,"reconnect_interval":5,"max_attempts":5,}).build())asyncdefon_connect():logging.info('Connected to the server')whilehub_connection.transport.state!=ConnectionState.connected:awaitasyncio.sleep(0.1)awaithub_connection.send("SendMessage",[])asyncdefon_message(message):passdefon_error(self,message:CompletionMessage):raiseException(message.error)hub_connection.on_open(on_connect)hub_connection.on_error(on_error)hub_connection.on("Message",on_message)awaithub_connection.start()try:whilehub_connection.transport.state==ConnectionState.connected:awaitasyncio.sleep(1)exceptKeyboardInterrupt:passfinally:awaithub_connection.stop()