Saravanan666/pypi-org huggingface dataset:
Package: aiortc
What isaiortc?aiortcis a library forWeb Real-Time Communication (WebRTC)andObject Real-Time Communication (ORTC)in Python. It is built on top ofasyncio, Python’s standard asynchronous I/O framework.The API closely follows its Javascript counterpart while using pythonic
constructs:promises are replaced by coroutinesevents are emitted usingpyee.EventEmitterTo learn more aboutaiortcpleaseread the documentation.Why should I useaiortc?The main WebRTC and ORTC implementations are either built into web browsers,
or come in the form of native code. While they are extensively battle tested,
their internals are complex and they do not provide Python bindings.
Furthermore they are tightly coupled to a media stack, making it hard to plug
in audio or video processing algorithms.In contrast, theaiortcimplementation is fairly simple and readable. As
such it is a good starting point for programmers wishing to understand how
WebRTC works or tinker with its internals. It is also easy to create innovative
products by leveraging the extensive modules available in the Python ecosystem.
For instance you can build a full server handling both signaling and data
channels or apply computer vision algorithms to video frames using OpenCV.Furthermore, a lot of effort has gone into writing an extensive test suite for
theaiortccode to ensure best-in-class code quality.Implementation statusaiortcallows you to exchange audio, video and data channels and
interoperability is regularly tested against both Chrome and Firefox. Here are
some of its features:SDP generation / parsingInteractive Connectivity Establishment, with half-trickle and mDNS supportDTLS key and certificate generationDTLS handshake, encryption / decryption (for SCTP)SRTP keying, encryption and decryption for RTP and RTCPPure Python SCTP implementationData ChannelsSending and receiving audio (Opus / PCMU / PCMA)Sending and receiving video (VP8 / H.264)Bundling audio / video / data channelsRTCP reports, including NACK / PLI to recover from packet lossInstallingThe easiest way to installaiortcis to run:pipinstallaiortcBuilding from sourceIf there are no wheels for your system or if you wish to build aiortc from
source you will need a couple of libraries installed on your system:Opus for audio encoding / decodingLibVPX for video encoding / decodingLinuxOn Debian/Ubuntu run:aptinstalllibopus-devlibvpx-devOS XOn OS X run:brewinstallopuslibvpxLicenseaiortcis released under theBSD license.
Package: aiortc-datachannel-only
aiortc-datachannel-onlyaiortc-datachannel-onlyis a fork fromaiortc, which does not require av, cffi or netifaces dependencies, but has a support for datachannels only.Install with:pip install aiortc-datachannel-onlyWhy?I have only need for datachannels, and I want a simple "pip install ..." to work without extra dependencies or build steps (some others have had the same need, issues78,118,243,324,364,436)Netifacesis no longer maintained, and does not have binaries for Python3.10Caveats:This library does not support ipv6 (which the originalaiortcdoes support)Currently this library uses only the primary ipv4 address (aiortccan use all of the ip4 addresses)Licenseaioice-datachannel-onlyis released under the same BSD license as the originalaiortclibrary.DevelopmentInstall:pip install .[dev]Build:python setup.py bdist_wheelRelease:twine upload dist/*
Package: aiortsp
This is a very simple asyncio library for interacting with an
RTSP server, with basic RTP/RTCP support.The intended use case is to provide a pretty low level control
of what happens at RTSP connection level, all in python/asyncio.This library does not provide any decoding capability,
it is up to the client to decide what to do with received RTP packets.One could easily decode usingOpenCVorPyAV, or not at all depending on the intended
use.Seeexamplesfor how to use the lib internals, butfor quick usage:importasynciofromaiortsp.rtsp.readerimportRTSPReaderasyncdefmain():# Open a reader (which means RTSP connection, then media session)asyncwithRTSPReader('rtsp://cam/video.sdp')asreader:# Iterate on RTP packetsasyncforpktinreader.iter_packets():print('PKT',pkt.seq,pkt.pt,len(pkt))asyncio.run(main())
Package: aioruuvigateway
aioruuvigatewayAn asyncio-native library for requesting data from a Ruuvi Gateway.InstallationRequires Python 3.7 or newer.pip install aioruuvigatewayUsageEnsure you have set up bearer token authentication in your Ruuvi Gateway (and that you know the token).APIDocumentation can be found intest_library.pyfor now, sorry.Command line interfaceYou can use the command line interface to test the library.python -m aioruuvigateway --host 192.168.1.249 --token bearbear --parse --jsonwill output data from the gateway in JSON format, printing changed information every 10 seconds.Licenseaioruuvigatewayis distributed under the terms of theMITlicense.
Package: aioruz
aioruzAsync HSE RUZ API client for Python 3.UsageTo obtain student's schedule:fromdatetimeimportdate,timedeltaimportasyncioimportaioruzasyncdefmain():# Get schedule on 10 days forwardprint(awaitaioruz.student_schedule(email='example1@edu.hse.ru',to_date=10))# Suitable for lecturers as there is no way to get lecturer's person_id by emailprint(awaitaioruz.schedule(person_type='lecturer',person_id=12345,from_date=date.today(),to_date=date.today()+timedelta(days=7))# Get student's info by emailprint(awaitaioruz.student_info('example@edu.hse.ru'))# Search for queryprint(awaitaioruz.search('some name'))loop=asyncio.get_event_loop()loop.run_until_completed(main())InstalliationInstall via Pip:pipinstallaioruzSecurityBy default SSL certificate validation is off. To ebale it, setaioruz.VERIFY_SSLtoTrue.importaioruzaioruz.VERIFY_SSL=TrueOr you can setRUZ_VERIFY_SSLenvironment virable toTrue.FeedbackPlease, send your bug reports tothisTelegram chat.
Package: aios3
File-like object for aiobotocoreWithstreamyou can create file-like object
to read fromaiobotocore"files" by chunks.DocumentationaioS3DevelopersDo not forget to run. ./activate.sh.Python github project templateYou can use this repository as template for your Python projects.It brings:Python virtual environment (seeactivate.sh)pre-commit configuration with mypy, flake8, black and docstrings linter (see.pre-commit-config.yaml,install pre-commitand activate it withpre-commit install)github pages:read the article, the site generated from md-files indocs/,docs/docstrings/is autogenerated from source code docstrings (see.github/workflows/docs.yml)pytest with examples of async tests and fixtures (seetests/)github actions to linter, test and to create github pages (see.github/workflows/)versions in git tags (seeverup.sh)publishing Python PIP packageread the article, automatically on git tag, also creates github release with link to the version on pypi.orgpinning dependencies versions usingpip-tools(seescripts/compile_requirements.sh)Scriptsmake help
Package: aio-s3
Status:AlphaTheaio-s3is a small library for accessing Amazon S3 Service that leverages
python’s standardasynciolibrary.Only read operations are supported so far, contributions are welcome.ExampleBasically all methods supported so far are shown in this example:import asynciofrom aios3.bucket import Bucket@asyncio.coroutinedef main():bucket = Bucket('uaprom-logs',aws_region='eu-west-1',aws_endpoint='s3-eu-west-1.amazonaws.com',aws_key='AKIAIOSFODNN7EXAMPLE',aws_secret='wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY')# List keys based on prefixlst = yield from bu.list('some-prefix')response = yield from bu.get(lst[0])print(len(response))response = yield from bu.download(lst[0])print("GOT Response", dir(response))while 1:chunk = yield from response.read(65536)print("Received", len(chunk))if not chunk:breakasyncio.get_event_loop().run_until_complete(main())ReferenceBucket(name, *, aws_key, aws_secret, aws_region, aws_endpoint, connector):Creates a wrapper object for accessing S3 bucket. Note unlike in many
other bindings you need to specify aws_region (and probably aws_endpoint)
correctly (see atable). Theconnectoris anaiohttpconnector,
which might be used to setup proxy or other useful things.Bucket.list(prefix='',max_keys=1000):Lists items which start with prefix. Each returned item is aKeyobject. This method is coroutine.NoteThis method raises assertion error if there are more keys than
max_keys. We do not have a method to return keys iteratively yet.Bucket.get(key):Fetches object nameskey. Thekeymight be a string orKeyobject. Returns bytes. This method is coroutine.Bucket.download(key):Allows iteratively download thekey. The object returned by the
coroutine is an object having method.read(bufsize)which is a
coroutine too.KeyRepresents an S3 key returned byBucket.list. Key has at least the
following attributes:key– the full name of the key stored in a bucketlast_modified–datetime.datetimeobjectetag– The ETag, usually md5 of the content with additional quotessize– Size of the object in bytesstorage_class– Storage class of the object
Package: aiosaber
A concurrent streaming packageDataflow based functional syntax.Implicitly parallelism for both async and non-async functions.Composable for both flows and tasks.Extensible with middlewares.InstallationpipinstallaiosaberExamplechecktestsfor more examples.fromaiosaberimport*@taskdefadd(self,num):foriinrange(100000):num+=1returnnum@taskasyncdefmultiply(num1,num2):returnnum1*num2@flowdefsub_flow(num):returnadd(num)|map_(lambdax:x**2)|add@flowdefmy_flow(num):[sub_flow(num),sub_flow(num)]|multiply|viewnum_ch=Channel.values(*list(range(100)))f=my_flow(num_ch)asyncio.run(f.start())Middleware examplefromaiosaberimport*classNameBuilder(BaseBuilder):def__call__(self,com,*args,**kwargs):super().__call__(com,*args,**kwargs)com.context['name']=type(com).__name__+str(id(com))classClientProvider(BaseExecutor):asyncdef__call__(self,com,**kwargs):ifnotcontext.context.get('client'):context.context['client']='client'returnawaitsuper().__call__(com,**kwargs)classFilter(BaseHandler):asyncdef__call__(self,com,get,put,**kwargs):asyncdeffilter_put(data):ifdataisENDordata>3:awaitput(data)returnawaitsuper().__call__(com,get,filter_put,**kwargs)@taskasyncdefadd(self,num):print(self.context['name'])print(context.context['client'])returnnum+1@flowdefmyflow(num_ch):returnnum_ch|add|viewcontext.context.update({'builders':[NameBuilder],'executors':[ClientProvider],'handlers':[Filter]})f=myflow(Channel.values(1,2,3,4,5))context.context.clear()asyncio.run(f.start())
Package: aiosasl
aiosaslprovides a generic, asyncio-based SASL library. It can be used with
any protocol, provided the neccessary interface code is provided by the
application or protocol implementation.DependenciesPython ≥ 3.5Supported SASL mechanismsPLAIN: authenticate with plaintext password (RFC 4616)ANONYMOUS: anonymous “authentication” (RFC 4505)SCRAM-SHA-1andSCRAM-SHA-256(and the-PLUSvariants with
channel binding): Salted Challenge Response Authentication (RFC 5802)DocumentationOfficial documentation can be built with sphinx and is available onlineon our servers.Supported channel binding methodstls-uniqueandtls-server-end-pointwith a pyOpenSSL connectionall methods supported by the Python standard library when using thesslmodule
Package: aiosc
aiosc is a minimalistic Open Sound Control (OSC) communication module
which uses asyncio for network operations and is compatible with the
asyncio event loop.Installationaiosc requires at least Python 3.7. It can be installed using pip:pip3 install aioscAlternatively, use--useroption to install aiosc only for the current user:pip3 install --user aioscUsageTo send OSC messages withaiosc, create an asyncio datagram connection
endpoint usingaiosc.OSCProtocolas the protocol factory.A datagram connection can be created with thecreate_datagram_endpointmethod of the asyncio event loop. Use the argumentremote_addrto specify
the OSC server address and port as follows:importasyncioimportaioscasyncdefmain():loop=asyncio.get_running_loop()transport,osc=awaitloop.create_datagram_endpoint(aiosc.OSCProtocol,remote_addr=('127.0.0.1',8000))osc.send('/hello/world')osc.send('/a/b/cde',1000,-1,'hello',1.234,5.678)asyncio.run(main())For an OSC server implementation,aiosc.OSCProtocolcan be subclassed
or directly constructed with a dictionary which maps OSC address patterns to
handler methods for incoming messages.When creating datagram connection for an OSC server withcreate_datagram_endpoint, use the argumentlocal_addrto specify
the interface (address) and listening port for the server.In a typical case, local address can look like('0.0.0.0', 9000)where9000is the port number and0.0.0.0address designates that the server
will be listening on all available network interfaces.importasyncioimportaioscimportsysclassEchoServer(aiosc.OSCProtocol):def__init__(self):super().__init__(handlers={'/sys/exit':lambdaaddr,path,*args:sys.exit(0),'//*':self.echo,})defecho(self,addr,path,*args):print("incoming message from{}:{}{}".format(addr,path,args))asyncdefmain():loop=asyncio.get_running_loop()transport,osc=awaitloop.create_datagram_endpoint(EchoServer,local_addr=('0.0.0.0',8000))awaitloop.create_future()asyncio.run(main())For more examples, seeexamples/.OSC address patternsaioscdispatches messages to handler methods using glob-style address
pattern matching as described in the OSC 1.0 specification. The//operator
from OSC 1.1 preliminary specification is also supported.Examples:/hello/worldmatches/hello/world./hello/*matches/hello/worldand/hello/sarah./{hello,goodbye}//worldmatches/hello/worldand/goodbye/cruel/world.//*matches any address.NotesBundles are not yet supported.OSC data types are picked from the preliminary spec documented in Features
and Future of Open Sound Control version 1.1 for NIME paper. For example,Itypetag is decoded to Impulse (aka “bang”) which is passed around
asaiosc.Impulsesingleton.Suggestions, bug reports, issues and/or pull requests are, of course, welcome.LicenseCopyright (c) 2014 Artem Popov <artfwo@gmail.com>aiosc is licensed under the MIT license, please see LICENSE file for details.
Package: aioscgi
What is aioscgi?aioscgi is a container implementing the Asynchronous Server Gateway Interface
(ASGI) to serve up asynchronous Web applications via the Simple Common Gateway
Interface protocol.What is SCGI?SCGI is a protocol used for communication between HTTP servers and Web
applications. Compared to CGI, SCGI is more efficient because it does not fork
and execute a separate instance of the application for every request; instead,
the application is launched ahead of time and receives multiple requests
(either sequentially or concurrently) via socket connections. Compared to
FastCGI, SCGI is a much simpler protocol as it uses a separate socket
connection for each request, rather than including framing within a single
connection to multiplex requests (a feature which is rarely used in FastCGI
anyway due to the lack of per-request flow control).See theWikipediaandPythonSCGI pages for more information.How do I install it?aioscgi’s releases are published on PyPI for installation through pip. You can
runpip install aioscgi.For development, the source is available atGitLabandGitHub.How do I use it?aioscgi installs anaioscgiexecutable. If your ASGI application callable
is namedmyappand is in a file calledmypackage/mymodule.py, you might
runaioscgi--unix-socket/path/to/socket mypackage.mymodule:myapp. For
full details on available options, runaioscgi--help.
Package: aiosched
aiosched - Python asyncio jobs schedulerExecutes specified asyncio jobs with a chosen interval. Has relatively small
number of features but it's fast.Why one more scheduler?it's extremely accurate and fastit's simpleall methods are thread-safeExamplefromaioschedimportschedulerimportasyncioasyncdeftest1(a,b,c):print(f'JOB1{a}{b}{c}')asyncdeftest2():print('JOB2')asyncdeftest3():print('JOB3')fromaioschedimportschedulerloop=asyncio.new_event_loop()scheduler.start(loop=loop)# jobs can be added before actual start in pending modejob1=scheduler.create_threadsafe(target=test1,args=(1,2,3),interval=1)job2=scheduler.create_threadsafe(target=test2,interval=0.5)# run job once after 5 secondsjob3=scheduler.create_threadsafe(target=test3,number=1,timer=5)# cancel job 2scheduler.cancel(job2)# equal tojob2.cancel()loop.run_forever()or run scheduler loop as coroutine:loop=asyncio.new_event_loop()job1=scheduler.create_threadsafe(target=test1,args=(1,2,3),interval=0.1)job2=scheduler.create_threadsafe(target=test2,interval=0.1)loop.run_until_complete(scheduler.scheduler_loop())Installpip3installaioschedAdvancedReadAsyncJobSchedulerandAsyncScheduledJobclasses documentation in
pydoc.
Package: aioschedule
Python job scheduling for humans. Forked and modified from github.com/dbader/schedule.An in-process scheduler for periodic jobs that uses the builder pattern
for configuration. Schedule lets you run Python functions (or any other
callable) periodically at pre-determined intervals using a simple,
human-friendly syntax.Inspired byAdam Wiggins’article“Rethinking Cron”and theclockworkRuby module.FeaturesA simple to use API for scheduling jobs.Very lightweight and no external dependencies.Excellent test coverage.Tested on Python 3.5, and 3.6Usage$pipinstallaioscheduleimportasyncioimportaioscheduleasscheduleimporttimeasyncdefjob(message='stuff',n=1):print("Asynchronous invocation (%s) of I'm working on:"%n,message)asyncio.sleep(1)foriinrange(1,3):schedule.every(1).seconds.do(job,n=i)schedule.every(5).to(10).days.do(job)schedule.every().hour.do(job,message='things')schedule.every().day.at("10:30").do(job)loop=asyncio.get_event_loop()whileTrue:loop.run_until_complete(schedule.run_pending())time.sleep(0.1)DocumentationSchedule’s documentation lives atschedule.readthedocs.io.Please also check the FAQ there with common questions.DevelopmentRunvagrant upto spawn a virtual machine containing the development
environment. Make sure to set theIBR_GIT_COMMITTER_NAMEandIBR_GIT_COMMITTER_EMAILenvironment variables.MetaDaniel Bader -@dbader_org-mail@dbader.orgCochise Ruhulessin -@magicalcochise-c.ruhulessin@ibrb.orgDistributed under the MIT license. SeeLICENSE.txtfor more information.https://github.com/ibrb/python-aioschedule
Package: aioscheduler
aioscheduleraioscheduler is a scalable and high-performance task scheduler for asyncio.It schedules execution of coroutines at a specific time in a single task, making it lightweight and extremely scalable by adding a manager for multiple schedulers.Tests have shown that aioscheduler can run up to 10 million timed tasks with up to 20 finishing per second when using 20 schedulers. Single tasks can easily schedule up to 10.000 tasks. This is based on tests on a Xeon E5 1650v3.Installationpip install aioschedulerUsageaioscheduler provides several Scheduler classes that runs a main task to consume coroutines.There areQueuedScheduler/LifoQueuedSchedulerandTimedScheduler, whereas TimedScheduler is the default for Managers.The TimedScheduler compares datetime objects to UTC by default, to disable it, passprefer_utc=Falseto the constructor.importasynciofromdatetimeimportdatetime,timedeltafromaioschedulerimportTimedSchedulerasyncdefwork(n:int)->None:print(f"I am doing heavy work:{n}")asyncdefmain()->None:starting_time=datetime.utcnow()scheduler=TimedScheduler()scheduler.start()foriinrange(60):scheduler.schedule(work(i),starting_time+timedelta(seconds=5+i))awaitasyncio.sleep(65)asyncio.run(main())In this example, 60 tasks are scheduled to run in 5 seconds from now, 1 of them per second over a time of 1 minute.The QueuedScheduler works identical, but consumes tasks in scheduling order immediately and only takes a single coroutine as argument toschedule().To scale even further, aioscheduler offers the Manager (example with QueuedScheduler backend):importasynciofromdatetimeimportdatetime,timedeltafromaioschedulerimportManager,QueuedSchedulerasyncdefwork(n:int)->None:print(f"I am doing heavy work:{n}")asyncdefmain()->None:starting_time=datetime.utcnow()manager=Manager(5,cls=QueuedScheduler)# The number of Schedulers to use# Leaving out cls defaults to TimedSchedulermanager.start()foriinrange(30000):manager.schedule(work(i))awaitasyncio.sleep(5)asyncio.run(main())The manager distributes the tasks across multiple schedulers internally and acts as a load-balancer.schedule()returns a Task object, you may cancel a task after scheduling by runningscheduler.cancel(task)(ormanager.cancel(task)). The manager is less efficient for cancelling.To limit the amount of tasks scheduled, there is amax_tasksargument that takes a positive integer. It is advised to use this in production enviroments of known task queue sizes and available on both Scheduler and Manager.LicenseMIT
Package: aioschluter
Schluter API Python wrapperAn async Python wrapper for theSchluter-DITRA-E-WIFIWi-Fi ThemostatUserCreate a user for your thermostats athttps://ditra-heat-e-wifi.schluter.com/InstallInstall the most recent version of the library fromPython Package Indexpip install aioschluterBasic ExampleimportasyncioimportloggingfromaiohttpimportClientError,ClientSessionfromaioschluterimport(ApiError,InvalidUserPasswordError,InvalidSessionIdError,SchluterApi,)## specify the username and password that you have on the Schluter DITRA-HEATER-E-WIFI## site at https://ditra-heat-e-wifi.schluter.com/SCHLUTER_USERNAME="XXXX"SCHLUTER_PASSWORD="XXXX"logging.basicConfig(level=logging.DEBUG)asyncdefmain():asyncwithClientSession()aswebsession:try:schluter=SchluterApi(websession)sessionid=awaitschluter.async_get_sessionid(SCHLUTER_USERNAME,SCHLUTER_PASSWORD)thermostats=awaitschluter.async_get_current_thermostats(sessionid)except(ApiError,ClientError,InvalidUserPasswordError,InvalidSessionIdError,)aserror:print(f"Error:{error}")else:forthermostatinthermostats.values():print(thermostat)loop=asyncio.get_event_loop()loop.run_until_complete(main())loop.close()