Saravanan666/pypi-org huggingface dataset:
Package: aiographite
An asyncio library for graphite.You can find out more here:http://aiographite.readthedocs.io/en/latest/What is aiographite ?aiographite is Python3 library ultilizing asyncio, designed
to help Graphite users to send data into graphite easily.Installing it globallyYou can install aiographite globally with any Python package manager:pip install aiographiteQuick startLet’s get started.from aiographite import connect
from aiographite.protocol import PlaintextProtocol

"""
  Initialize a aiographite instance
"""
loop = asyncio.get_event_loop()
plaintext_protocol = PlaintextProtocol()
graphite_conn = await connect(*httpd.address, plaintext_protocol, loop=loop)


"""
  Send a tuple (metric, value , timestamp)
"""
await graphite_conn.send(metric, value, timestamp)


"""
  Send a list of tuples List[(metric, value , timestamp)]
"""
await graphite_conn.send_multiple(list)


"""
  aiographite library also provides GraphiteEncoder module,
  which helps users to send valid metric name to graphite.
  For Example: (metric_parts, value ,timestamp)
"""
metric = graphite_conn.clean_and_join_metric_parts(metric_parts)
await graphite_conn.send(metric, value, timestamp)


"""
  Close connection
"""
await graphite_conn.close()ExampleA simple example.from aiographite.protocol import PlaintextProtocol
from aiographite import connect
import time
import asyncio


LOOP = asyncio.get_event_loop()
SERVER = '127.0.0.1'
PORT = 2003


async def test_send_data():
  # Initiazlize an aiographite instance
  plaintext_protocol = PlaintextProtocol()
  graphite_conn = await connect(SERVER, PORT, plaintext_protocol, loop=LOOP)

  # Send data
  timestamp = time.time()
  for i in range(10):
    await graphite_conn.send("yun_test.aiographite", i, timestamp + 60 * i)))


def main():
  LOOP.run_until_complete(test_send_data())
  LOOP.close()


if __name__ == '__main__':
  main()DevelopmentRun unit tests../uranium testGraphite setupDo not have graphite instances ? Set up a graphite instance on your local machine!Please refer:https://github.com/yunstanford/MyGraphitehttps://github.com/yunstanford/GraphiteSetup
Package: aiographql
asyncio- explicit concurrencyto reduce race conditionsgraphql- all you need and nothing more in one request +auto docs of your apiuvloop, protocol-top performanceminimal http - unlike REST frameworks that are waste of time for/graphqlendpointpluggable context - for auth, logging, etcexception handling - at all levels, with default or custom handlerUsage:pip install aiographql

cat <<'END' >serve.py
import asyncio, aiographql, graphene

class User(graphene.ObjectType):
    id = graphene.ID(required=True)
    name = graphene.String()

class Query(graphene.ObjectType):
    me = graphene.Field(User)

    async def resolve_me(self, info):
        await asyncio.sleep(1)  # DB
        return User(id=42, name='John')

schema = graphene.Schema(query=Query, mutation=None)

aiographql.serve(schema, listen=[
    dict(protocol='tcp', port=25100),
    dict(protocol='unix', path='/tmp/worker0'),
])
END

python3 serve.py

curl http://localhost:25100/ --data-binary \
'{"query": "{
    me {
        id
        name
    }
}", "variables": null}'

# OR:
curl --unix-socket /tmp/worker0 http:/ --data-binary ...

# Result:
# 1 second async await for DB and then:
{"data":{"me":{"id":"42","name":"John"}}}Seemore examples and testsabout JWT auth, concurrent slow DB queries, etc.Config:import aiographql; help(aiographql.serve)

serve(schema, listen, get_context=None, exception_handler=None, enable_uvloop=True, run=True)
    Configure the stack and start serving requestsschema:graphene.Schema- GraphQL schema to servelisten:list- one or more endpoints to listen for connections:dict(protocol='tcp',port=25100,...)-create_server() docsdict(protocol='unix',path='/tmp/worker0',...)-create_unix_server() docsget_context:Noneor[async] callable(loop, context: dict): mixed- to produce GraphQL context like auth from input unified withexception_handler()exception_handler:Noneorcallable(loop, context: dict)- default or custom exception handler as defined inthe docs+headers:bytesorNone- HTTP headers, if knownrequest:dictorbytesorNone- accumulated HTTP request before content length is known, then accumulated content, then GraphQL requestenable_uvloop:bool- enable uvloop for top performance, unless you have a better looprun:bool- ifTrue, run the loop;Falseis good for testsreturnservers:Servers-await servers.close()to close listening sockets - good for tests
Package: aiographql-client
Asynchronous GraphQL ClientAn asynchronous GraphQL client built on top of aiohttp and graphql-core-next. The client by default introspects schemas and validates all queries prior to dispatching to the server.DocumentationFor the most recent project documentation, you can visithttps://aiographql-client.readthedocs.io/.Installationpip install aiographql-clientExample UsageHere are some example usages of this client implementation. For more examples, and advanced scenarios,
seeUsage Examplessection in
the documentation.Simple Queryasyncdefget_logged_in_username(token:str)->GraphQLResponse:client=GraphQLClient(endpoint="https://api.github.com/graphql",headers={"Authorization":f"Bearer{token}"},)request=GraphQLRequest(query="""query {viewer {login}}""")returnawaitclient.query(request=request)>>> import asyncio>>> response = asyncio.run(get_logged_in_username("<TOKEN FROM GITHUB GRAPHQL API>"))>>> response.data{'viewer': {'login': 'username'}}Query Subscriptionasyncdefprint_city_updates(client:GraphQLClient,city:str)->None:request=GraphQLRequest(query="""subscription ($city:String!) {city(where: {name: {_eq: $city}}) {descriptionid}}""",variables={"city":city},)# subscribe to data and error events, and print themawaitclient.subscribe(request=request,on_data=print,on_error=print,wait=True)For custom event specific callback registration, seeCallback Registry Documentation.Query Validation FailuresIf your query is invalid, thanks to graphql-core-next, we get a detailed exception in the traceback.aiographql.client.exceptions.GraphQLClientValidationException: Query validation failed

Cannot query field 'ids' on type 'chatbot'. Did you mean 'id'?

GraphQL request (4:13)
3:           chatbot {
4:             ids, bot_names
               ^
5:           }

Cannot query field 'bot_names' on type 'chatbot'. Did you mean 'bot_name' or 'bot_language'?

GraphQL request (4:18)
3:           chatbot {
4:             ids, bot_names
                    ^
5:           }Query Variables & OperationsSupport for multi-operation requests and variables is available via the client. For example,
the following request contains multiple operations. The instance specifies default values to use.request=GraphQLRequest(query="""query get_bot_created($id: Int) {chatbot(where: {id: {_eq: $id}}) {id, created}}query get_bot_name($id: Int) {chatbot(where: {id: {_eq: $id}}) {id, bot_name}}""",variables={"id":109},operation="get_bot_name")The default values can be overridden at the time of making the request if required.awaitclient.query(request=request,variables={"id":20},operation="get_bot_created")
Package: aiograpi
Asynchronous Instagram Private API wrapper.Use the most recent version of the API from Instagram.Features:Performs Public API (web, anonymous) or Private API (mobile app, authorized)
requests depending on the situation (to avoid Instagram limits)Challenge Resolver have Email (as well as recipes for automating receive a code from email) and SMS handlersSupport upload a Photo, Video, IGTV, Clips (Reels), Albums and StoriesSupport work with User, Media, Insights, Collections, Location (Place), Hashtag and Direct objectsLike, Follow, Edit account (Bio) and much more elseInsights by account, posts and storiesBuild stories with custom background, font animation, swipe up link and mention users
Package: aiogrn
asyncioGroongaClient.RequirementsPython3.5+UsageGQTPimportasynciofromaiogrn.clientimportGroongaClientasyncdeffetch(grn,cmd,**kwargs):ret=awaitgrn.call(cmd,**kwargs)print(ret)loop=asyncio.get_event_loop()grn=GroongaClient(host='localhost',port=10043,protocol='gqtp',loop=loop)tasks=[asyncio.ensure_future(fetch(grn,'status')),asyncio.ensure_future(fetch(grn,'select',table='Foo')),asyncio.ensure_future(fetch(grn,'status'))]loop.run_until_complete(asyncio.gather(*tasks))loop.close()HTTPimportasynciofromaiogrn.clientimportGroongaClientasyncdeffetch(grn,cmd,**kwargs):ret=awaitgrn.call(cmd,**kwargs)print(ret)loop=asyncio.get_event_loop()grn=GroongaClient(loop=loop)tasks=[asyncio.ensure_future(fetch(grn,'status')),asyncio.ensure_future(fetch(grn,'select',table='Foo')),asyncio.ensure_future(fetch(grn,'status'))]loop.run_until_complete(asyncio.gather(*tasks))loop.close()
Package: aiogrobid
aiogrobidAsynchronous client for Grobid APIExampleimportasynciofromaiogrobidimportGrobidClientasyncdefworks(doi):client=GrobidClient()returnawaitclient.works(doi)response=asyncio.get_event_loop().run_until_complete(works('10.21100/compass.v11i2.812'))assert(response=={'DOI':'10.21100/compass.v11i2.812','ISSN':['2044-0081','2044-0073'],'URL':'http://dx.doi.org/10.21100/compass.v11i2.812','abstract':'<jats:p>Abstract: Educational policy and provision is ''ever-changing; but how does pedagogy need to adapt to respond ''to transhumanism? This opinion piece discusses transhumanism, ''questions what it will mean to be posthuman, and considers the ''implications of this on the future of education.</jats:p>','author':[{'affiliation':[],'family':'Gibson','given':'Poppy Frances','sequence':'first'}],'container-title':['Compass: Journal of Learning and Teaching'],'content-domain':{'crossmark-restriction':False,'domain':[]},'created':{'date-parts':[[2018,12,17]],'date-time':'2018-12-17T09:42:26Z','timestamp':1545039746000},'deposited':{'date-parts':[[2019,6,11]],'date-time':'2019-06-11T10:29:57Z','timestamp':1560248997000},'indexed':{'date-parts':[[2020,4,14]],'date-time':'2020-04-14T14:52:16Z','timestamp':1586875936184},'is-referenced-by-count':0,'issn-type':[{'type':'print','value':'2044-0073'},{'type':'electronic','value':'2044-0081'}],'issue':'2','issued':{'date-parts':[[2018,12,10]]},'journal-issue':{'issue':'2','published-online':{'date-parts':[[2018,12,10]]}},'link':[{'URL':'https://journals.gre.ac.uk/index.php/compass/article/viewFile/812/pdf','content-type':'application/pdf','content-version':'vor','intended-application':'text-mining'},{'URL':'https://journals.gre.ac.uk/index.php/compass/article/viewFile/812/pdf','content-type':'unspecified','content-version':'vor','intended-application':'similarity-checking'}],'member':'8854','original-title':[],'prefix':'10.21100','published-online':{'date-parts':[[2018,12,10]]},'publisher':'Educational Development Unit, University of Greenwich','reference-count':0,'references-count':0,'relation':{},'score':1.0,'short-container-title':['Compass'],'short-title':[],'source':'Crossref','subtitle':[],'title':['From Humanities to Metahumanities: Transhumanism and the Future ''of Education'],'type':'journal-article','volume':'11'})
Package: aiogTTS
aiogTTSaiogTTS(asynchronous Google Text-to-Speech), a Python library to interface with Google Translate's text-to-speech API.
Writes spoken mp3 data to a file or a file-like object (bytestring) for further audiomanipulation.Original gTTS -https://github.com/pndurette/gTTS/(75% of this repo)FeaturesCustomizable speech-specific sentence tokenizer that allows for unlimited lengths of text to be read, all while keeping proper intonation, abbreviations, decimals and more;Customizable text pre-processors which can, for example, provide pronunciation corrections;Installation$pipinstallaiogTTSQuickstartimportasynciofromioimportBytesIOfromaiogttsimportaiogTTSasyncdefmain():aiogtts=aiogTTS()io=BytesIO()awaitaiogtts.save('Привет, мир!','audio.mp3',lang='ru')awaitaiogtts.write_to_fp('Hallo!',io,slow=True,lang='de')asyncio.get_event_loop().run_until_complete(main())
Package: aioguardian
🚰 aioguardian: A Python3 library for Elexa Guardian devicesaioguardianis a Python3,asyncio-focused library for interacting withthe Guardian line of water valves and sensors from Elexa.InstallationPython VersionsDocumentationContributingInstallationpipinstallaioguardianPython Versionsaioguardianis currently supported on:Python 3.10Python 3.11Python 3.12DocumentationComplete documentation can be foundhere.ContributingThanks to all ofour contributorsso far!Check for open features/bugsorinitiate a discussion on one.Fork the repository.(optional, but highly recommended) Create a virtual environment:python3 -m venv .venv(optional, but highly recommended) Enter the virtual environment:source ./.venv/bin/activateInstall the dev environment:script/setupCode your new feature or bug fix on a new branch.Write tests that cover your new functionality.Run tests and ensure 100% code coverage:poetry run pytest --cov aioguardian testsUpdateREADME.mdwith any new documentation.Submit a pull request!
Package: aioguest
Trio, an alternate async framework
for Python, supports a feature called“guest mode”where it can run in the same thread as
another event loop. In guest mode, low-level I/O waiting occurs on a worker thread,
but the threading is invisible to user code, and both event loops can interact
with each other without any special synchronization.This package implements guest mode for asyncio. It has one public function:aioguest.start_guest_run(
    coro,
    *,
    run_sync_soon_threadsafe,
    done_callback,
    run_sync_soon_not_threadsafe=None,
    debug=None,
    loop_factory=None,
)This effectively starts a call toasyncio.run(coro)in parallel
with the currently running (“host”) event loop. Thedebugparameter
is passed toasyncio.run()if specified.  On Python 3.11+, you can
also supply aloop_factorywhich will be passed toasyncio.Runner().The parametersrun_sync_soon_threadsafe,done_callback, and (optionally)run_sync_soon_not_threadsafetellaioguesthow to interact with the host
event loop. Somedayaioguestwill have documentation of its own.
Until then, see theTrio documentationfor details on these parameters, including anexample.start_guest_run()returns the main task of the new asyncio run, i.e.,
theasyncio.Taskthat wrapscoro. It may also return None if the main task
could not be determined, such as becauseasyncio.run()raised an exception
before starting to executecoro. The main task is provided mostly for
cancellation purposes; while you can also register callbacks upon its completion,
the run is not necessarily finished at that point, because background tasks and
async generators might still be in the process of finalization.Exceptions noticed when starting up the asyncio run might either propagate out ofstart_guest_run()or be delivered to yourdone_callback, maybe even beforestart_guest_run()returns (it will return None in that case). In general,
problems noticed byaioguestwill propagate out ofstart_guest_run(),
while problems noticed by asyncio will be delivered to yourdone_callback.aioguestrequires Python 3.8 or later. Out of the box it supports
the default asyncio event loop implementation (only) on Linux,
Windows, macOS, FreeBSD, and maybe others. It does not support
operating systems that provide onlyselect()orpoll(); due to
thread-safety considerations it needs an I/O abstraction where the OS
kernel is involved in registrations, such as IOCP, epoll, or kqueue.
Alternative Python-based event loops can likely be supported given
modest effort if they use such an abstraction. Alternative C-based
event loops (such as uvloop) present much more of a challenge because
compiled code generally can’t be monkeypatched.Development statusaioguesthas been tested with a variety of toy examples and
pathological cases, and its unit tests exercise full coverage. It
hasn’t had a lot of exposure to real-world problems yet.  Maybe you’d
like to expose it to yours?Licenseaioguestis licensed under your choice of the MIT or Apache 2.0
license. SeeLICENSEfor details.
Package: aioh2
aioh2HTTP/2 implementation withhyper-h2on Python 3 asyncio.Free software: BSD licenseDocumentation:https://aioh2.readthedocs.org.FeaturesAsynchronous HTTP/2 client and serverMultiplexing streams of data with managed flow and priority controlOptional tickless health checkMore to comeNon-features:Request/Response wrappersWeb server, dispatcher, cookie, etcHTTP/2 upgradeExampleA server saying hello:# Server request handlerasyncdefon_connected(proto):try:whileTrue:# Receive a request from queuestream_id,headers=awaitproto.recv_request()# Send response headersawaitproto.start_response(stream_id,{':status':'200'})# Response body starts with "hello"awaitproto.send_data(stream_id,b'hello, ')# Read all request body as a name from client sidename=awaitproto.read_stream(stream_id,-1)# Amend response body with the nameawaitproto.send_data(stream_id,name)# Send trailers with the length of the nameawaitproto.send_trailers(stream_id,{'len':str(len(name))})exceptasyncio.CancelledError:# do cleanup herepass# Start server on random port, with maximum concurrent requests of 3server=awaitaioh2.start_server(on_connected,port=0,concurrency=3)port=server.sockets[0].getsockname()[1]And a client to try out:# Open client connectionclient=awaitaioh2.open_connection('0.0.0.0',port,functional_timeout=0.1)# Optionally wait for an ack of tickless ping - a.k.a. until functionalawaitasyncio.sleep(0.1)# simulate client being busy with something elsertt=awaitclient.wait_functional()ifrtt:print('Round-trip time:%.1fms'%(rtt*1000))# Start request with headersstream_id=awaitclient.start_request({':method':'GET',':path':'/index.html'})# Send my name "world" as whole request bodyawaitclient.send_data(stream_id,b'world',end_stream=True)# Receive response headersheaders=awaitclient.recv_response(stream_id)print('Response headers:',headers)# Read all response bodyresp=awaitclient.read_stream(stream_id,-1)print('Response body:',resp)# Read response trailerstrailers=awaitclient.recv_trailers(stream_id)print('Response trailers:',trailers)client.close_connection()awaitasyncio.sleep(.1)Above example can be found atexamples/core.py.CreditsA big thanks to the great libraryhyper-h2fromCory Benfield.DecentFoX Studiois a software outsourcing company delivering high-quality
web-based products and mobile apps for global customers with agile methodology,
focusing on bleeding-edge technologies and fast-developing scalable architectures.This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.2.1 (2017-12-03)Updated to h2 3.0 (Contributed by Arthur Darcet and Peter Wu)Dropped support for Python 3.30.1.0 (2016-2-6)First release on PyPI.
Package: aiohandler
aiohandleraiohandler = aiohttp http handleraiohandler is a logging extension module.By using this module, logs can be sent by webhook.installingInstall and update using pip:pip install aiohandlerA simple example.Enter the parameters required for sending the webhook in the body.importasyncioimportloggingimportaiohandlerWEBHOOK_URL="Your webhook url"logger=logging.getLogger()handler=aiohandler.AioHTTPHandler(WEBHOOK_URL,method="POST",body="content")logger.addHandler(handler)loop=asyncio.get_event_loop()asyncdefmain():print("hello!")logging.info('info')logging.debug('debug')logging.error('error')awaitasyncio.sleep(1)logging.warning('warning')logging.critical('critical')print("hello world!")if__name__=="__main__":loop.create_task(main())loop.run_forever()Thank you to everyone who Helped me (#^^#)
Package: aiohappyeyeballs
aiohappyeyeballsDocumentation:https://aiohappyeyeballs.readthedocs.ioSource Code:https://github.com/aio-libs/aiohappyeyeballsHappy EyeballsUse caseThis library exists to allow connecting with Happy Eyeballs when you
already have a list of addrinfo and not a DNS name.The stdlib version ofloop.create_connection()will only work when you pass in an unresolved name which
is not a good fit when using DNS caching or resolving
names via another method such waszeroconf.InstallationInstall this via pip (or your favourite package manager):pip install aiohappyeyeballsExample usageaddr_infos=awaitloop.getaddrinfo("example.org",80)socket=awaitstart_connection(addr_infos)socket=awaitstart_connection(addr_infos,local_addr_infos=local_addr_infos,happy_eyeballs_delay=0.2)transport,protocol=awaitloop.create_connection(MyProtocol,sock=socket,...)# Remove the first address for each family from addr_infopop_addr_infos_interleave(addr_info,1)# Remove all matching address from addr_inforemove_addr_infos(addr_info,"dead::beef::")# Convert a local_addr to local_addr_infoslocal_addr_infos=addr_to_addr_infos(("127.0.0.1",0))CreditsThis package contains code from cpython and is licensed under the same terms as cpython itself.This package was created withCopierand thebrowniebroke/pypackage-templateproject template.
Package: aiohcaptcha
aiohcaptchaAsyncIO client for the hCaptcha serviceSecure your forms using a captcha.Installpip install aiohcaptchaUsageConfigurationYou can define the secret keyHCAPTCHA_SECRET_KEYin the environment or directly pass it to theHCaptchaClientmodel as a parameter.Get the secret and public keys from thehcaptcha.com.Template<div class="h-captcha" data-sitekey="your_site_key"></div>
<script src="https://hcaptcha.com/1/api.js" async defer></script>CheckhCaptcha docsfor more details on the HTML widget.Viewfrom aiohcaptcha import HCaptchaClient

response_token = request.POST["h-captcha-response"]
client = HCaptchaClient(secret_key)
verified = await client.verify(response_token)  # a booleanYou can adjust it to any Python Web framework that has async view support.If you are sending the form data using an AJAX request, use$('textarea[name=h-captcha-response]').val();for the captcha key.Response detailsResponse details are stored inclient.response,
details of theHCaptchaResponsemodel is same as the JSON response provided in the hCaptcha documentation.Extra argumentsYou can also addremote_ipandsitekey(expected key) to theclient.verifyfunction.
These parameters are explained in thehCaptcha docs.For unit testing, you can create the ClientHCaptchaClientwithdebug=Trueparameter.
In this mode, theverifyfunction will returnTrueif theuser_responsetoken andsitekeyparameters do match, otherwise it will returnFalse:client = HCaptchaClient("<SECRET_KEY>", debug=True)
assert await client.verify("<USER_TOKEN>", sitekey="<SAME_TOKEN>")
assert await client.verify("<USER_TOKEN>", sitekey="<DIFFERENT_TOKEN>") is False© 2020 Emin Mastizada. MIT Licenced.
Package: aiohealthcheck
aiohealthcheckThis tiny module provides a simple TCP endpoint, suitable for a healthcheck
in your microservice application. All it provides is a simple TCP endpoint
on a port to allow a container orchestration service to connect to, to
verify that the application is up.DemoPretty much just start up a long-lived task with the providedtcp_health_endpoint()coroutine function:loop.create_task(aiohealthcheck.tcp_health_endpoint(port=5000))The internal TCP server will be shut down when the task is cancelled, e.g.,
during your app’s shutdown sequence.Kubernetes Example Configurationports:
- name: liveness-port
  containerPort: 5000
livenessProbe:
  tcpSocket:
    port: liveness-port
  initialDelaySeconds: 15
  periodSeconds: 20
Package: aioHelloWorld
Asynchronous module for printing your dream programmeHello Worldin Python.Installingpip install aioHelloWorldExampleimport aioHelloWorld
import asyncio


async def main():
    await aioHelloWorld.say()

if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(main())GithubYou can view the source codehereSupportYou can find me ondiscordThank You :)