Saravanan666/pypi-org huggingface dataset:
Package: aio-doh
aio-dohIs a tiny asynchronous client for Google’s PublicDNS-over-HTTPSservice. It is built on top ofasyncioandaiohttpInstallationpipinstallaio-dohExample usage>>>fromdohimportDOHClient>>>fromasyncioimportget_event_loop>>>>>>loop=get_event_loop()>>>client=DOHClient(loop)>>>loop.run_until_complete(client.resolve('example.com'))['93.184.216.34']>>>APIThe API is simple and smallDOHClient.query(hostname, type, dnssec)hostname- name of a target host;type- DNS record type for a query;dnssec- enable DNSSEC validation. Returns a complete DNS response as a python dictionary.DOHClient.resolve(hostname, type, dnssec)hostname- name of a target host;type- DNS record type for a query;dnssec- enable DNSSEC validation. Returns a list of IP adresses.DOHClient.gethostbyname(hostname, type, dnssec)hostname- name of a target host;type- DNS record type for a query;dnssec- enable DNSSEC validation. Returns the first IP adress found if any or raises an error.DocumentationTODOContributingFile and issue or create a pull request.
Package: aiodown
aiodownAnasyncio-basedfile downloader made inPython 3usinghttpx.RequirementsPython 3.8 or higher.httpx 0.14 or higher.async-files 0.4 or higher.InstallationNOTE:Ifpython3is "not a recognized command" try usingpythoninstead.For the latest stable version:python3 -m pip install aiodownFor the latest development version:python3 -m pip install git+https://github.com/AmanoTeam/aiodownWhat's left to do?Write the API Documentation.Show some examples.LicenseMIT © 2021AmanoTeamChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog.1.0.4 (March 14th, 2021)AddedAssert that the status code is 200.ChangedImprove code based on Codacy.The downloads are runned in a executor instead of threads.1.0.3 (March 13th, 2021)Addedaiodown.errorspackage.1.0.2 (March 13th, 2021)Addedclient.rem()method.download.get_attempts(),download.get_id(),download.get_retries()anddownload.get_start_time()methods.1.0.1 (March 12th, 2021)AddedSupport for download retries.await download.resume()method.Changedclient.add()instead ofclient.download()method.1.0.0 (March 12th, 2021)First release.
Package: aiodownloads
aiodownloadsAsynchronous downloadsInstallationpip install aiodownloadsUsageInheritaiodownloads.Downloaderthen override handle_success, handle_fail methodsExamplesDownload list of urlsimportasynciofromaiodownloadsimportDownloaderurls=['https://httpbin.org/status/200','https://httpbin.org/status/400']classUrlsDownloader(Downloader):asyncdefhandle_success(self,resp,item):content=awaitresp.read()# save content stuffasyncdefhandle_fail(self,resp,item):...url_downloader=UrlsDownloader()asyncio.run(url_downloader.download(urls))
Package: aio-dprcon
A library and console client for DarkPlaces RCON protocolInstallation$pipinstallaio-dprconTo use the console tool on windows please also install pyreadline$pipinstallpyreadlineConsole tool usage$dprconadd# Add a server$dprconrefreshSERVER_NAME# Fill completion cache (optional)$dprconconnectSERVER_NAME# Launch interactive RCON shellOr watch an ascii cast here -https://asciinema.org/a/148143Library APITo be written
Package: aiodtnsim
aiodtnsimA minimal framework for performing DTN simulations based on Python 3.7 and asyncio.Note that this project is still awork in progress.RequirementsPython 3.7+NumPytqdm for the progress barsdtn-tvg-utilfor uPCN integration,uPCNv0.7.0+ with thepyupcnmodule installed in the Python environmentGetting StartedJust installaiodtnsimviapip, e.g., in a virtual environment:pip install aiodtnsimFor generating satellite scenarios (needed by the example script), you need to install thedtn-tvg-utilRing Road dependencies additionally:pip install "dtn-tvg-util[ring_road]"Now, you should be able to use the example scripts provided in the root directory ofaiodtnsimto perform simple simulation runs, e.g. via:bash examples/example_test_run.shDevelopment SetupFirst, clone theaiodtnsim,dtn-tvg-util, andupcnrepositories (the latter only for using uPCN emulation) and change into theaiodtnsimdirectory.
Now, create a virtual environment and install the required dependencies:python3 -m venv --without-pip .venv
curl -sS https://bootstrap.pypa.io/get-pip.py | .venv/bin/python
source .venv/bin/activate
pip install -e .
pip install -e "../dtn-tvg-util[ring_road,gs_placement]"
pip install -U -r ../upcn/pyupcn/requirements.txt
python ../upcn/pyupcn/install.pyIf you want to perform a run with uPCN, ensure the latest binary has been built:cd ../upcn
makeLicenseaiodtnsimis provided under the MIT license. SeeLICENSEfor details.AcknowledgmentsThe simulation event loop is based uponcode by Damon Wischik.
Package: aioduckdb
aioduckdb provides a friendly, async interface to DuckDB databases. It has been ported from the original aiosqlite module.It replicates theduckdbmodule, but with async versions
of all the standard connection and cursor methods, plus context managers for
automatically closing connections and cursors:async with aioduckdb.connect(...) as db:
    await db.execute("INSERT INTO some_table ...")
    await db.commit()

    async with db.execute("SELECT * FROM some_table") as cursor:
        async for row in cursor:
            ...It can also be used in the traditional, procedural manner:db = await aioduckdb.connect(...)
cursor = await db.execute('SELECT * FROM some_table')
row = await cursor.fetchone()
rows = await cursor.fetchall()
await cursor.close()
await db.close()Installaioduckdb is compatible with Python 3.6 and newer.
~~You can install it from PyPI:~~ Not currently on PyPI.Detailsaioduckdb allows interaction with DuckDB databases on the main AsyncIO event
loop without blocking execution of other coroutines while waiting for queries
or data fetches.  It does this by using a single, shared thread per connection.
This thread executes all actions within a shared request queue to prevent
overlapping actions.Connection objects are proxies to the real connections, contain the shared
execution thread, and provide context managers to handle automatically closing
connections.  Cursors are similarly proxies to the real cursors, and provide
async iterators to query results.Licenseaioduckdb is copyright Salvador Pardiñas, and licensed under the
MIT license.  I am providing code in this repository to you under an open source
license.  This is my personal repository; the license you receive to my code
is from me and not from my employer. See theLICENSEfile for details.Big thanks toAmethyst Reesefor the originalaiosqliterepository.
Package: aiodynamo
AsyncIO DynamoDBAsynchronous pythonic DynamoDB client;2xfaster thanaiobotocore/boto3/botocore.Quick startWith httpxInstall this librarypip install "aiodynamo[httpx]"or, for poetry userspoetry add aiodynamo -E httpxConnect to DynamoDBfromaiodynamo.clientimportClientfromaiodynamo.credentialsimportCredentialsfromaiodynamo.http.httpximportHTTPXfromhttpximportAsyncClientasyncwithAsyncClient()ash:client=Client(HTTPX(h),Credentials.auto(),"us-east-1")With aiohttpInstall this librarypip install "aiodynamo[aiohttp]"or, for poetry userspoetry add aiodynamo -E aiohttpConnect to DynamoDBfromaiodynamo.clientimportClientfromaiodynamo.credentialsimportCredentialsfromaiodynamo.http.aiohttpimportAIOHTTPfromaiohttpimportClientSessionasyncwithClientSession()assession:client=Client(AIOHTTP(session),Credentials.auto(),"us-east-1")API usetable=client.table("my-table")# Create table if it doesn't existifnotawaittable.exists():awaittable.create(Throughput(read=10,write=10),KeySchema(hash_key=KeySpec("key",KeyType.string)),)# Create or override an itemawaittable.put_item({"key":"my-item","value":1})# Get an itemitem=awaittable.get_item({"key":"my-item"})print(item)# Update an item, if it exists.awaittable.update_item({"key":"my-item"},F("value").add(1),condition=F("key").exists())Why aiodynamoboto3 and botocore are synchronous. aiodynamo is built forasynchronousapps.aiodynamo isfast. Two times faster than aiobotocore, botocore or boto3 for operations such as query or scan.aiobotocore is very low level. aiodynamo provides apythonic API, using modern Python features. For example, paginated APIs are automatically depaginated using asynchronous iterators.Legible source code. botocore and derived libraries generate their interface at runtime, so it cannot be inspected and isn't typed. aiodynamo is hand written code you can read, inspect and understand.Pluggable HTTP client. If you're already using an asynchronous HTTP client in your project, you can use it with aiodynamo and don't need to add extra dependencies or run into dependency resolution issues.Complete documentation is here
Package: aioeachlimit
aioeachlimitApply an async function to each item in an array or queue with limited concurrencyInstallpip install aioeachlimitUsageasync def f(item):
    asyncio.sleep(3)
	return item * 2

items = [1, 2, 3, 4]

async for result in aioeachlimit(items, f, concurrency_limit=2):
	print(result)  # Prints 2 4 6 8 in random orderIf you don't need to return anything:await aioeachlimit(items, f, concurrency_limit=2, discard_results=True)Ifitemsis anasyncio.Queuethen aioeachlimit will read from it indefinitely.Testspytest .
Package: aioeagle
AioeagleAsynchronous library to control Rainforest EAGLE-200Requires Python 3.8+ and uses asyncio and aiohttp.importasynciofrompprintimportpprintimportaiohttpfromaioeagleimportEagleHubCLOUD_ID="123456"INSTALL_CODE="abcdefghijklmn"asyncdefmain():asyncwithaiohttp.ClientSession()assession:awaitrun(session)asyncdefrun(websession):hub=EagleHub(websession,CLOUD_ID,INSTALL_CODE)devices=awaithub.get_device_list()iflen(devices)==0:print("No devices found")returndevice=devices[0]pprint(device.details)print()pprint(awaitdevice.get_device_query(device.ENERGY_AND_POWER_VARIABLES))asyncio.run(main())Testing locallypython3example.py<cloud_id><install_code>TimeoutsAioeagle does not specify any timeouts for any requests. You will need to specify them in your own code. We recommend theasync_timeoutpackage:importasync_timeoutwithasync_timeout.timeout(10):devices=awaithub.get_device_list()Contribution guidelinesObject hierarchy and property/method names should match the EAGLE-200 API.
Package: aio-eapi
Arista EOS API asyncio ClientThis repository contains an Arista EOS asyncio client.Quick ExampleThie following shows how to create a Device instance and run a list of
commands.Device will use HTTPS transport by default.  The Device instance supports the
following initialization parameters:host- The device hostname or IP addressusername- The login usernamepassword- The login passwordproto-(Optional)Choose either "https" or "http", defaults to "https"port-(Optional)Chose the protocol port to override proto defaultThe Device class inherits directly from httpx.AsyncClient.  As such, the Caller
can provide any initialization parameters.  The above specific parameters are
all optional.importjsonfromaioeapiimportDeviceusername='dummy-user'password='dummy-password'asyncdefrun_test(host):dev=Device(host=host,username=username,password=password)res=awaitdev.cli(commands=['show hostname','show version'])json.dumps(res)ReferencesArista eAPI documents require an Arista Portal customer login.  Once logged into the
system you can find the documents in the Software Download area.  Select an EOS release
and then select the Docs folder.You can also take a look at the Arista community client,here.
Package: aioEasyPillow
aioEasyPillowA python library based oneasy-pilandPillowto easily edit/modify images.InstallationPython 3.8 or above is requiredTo install the library directly from PyPI you can just run the following command:# Linux/macOSpython3-mpipinstall-U"discord.py[voice]"# Windowspy-3-mpipinstall-Udiscord.py[voice]Quick ExampleimportasynciofromaioEasyPillowimportEditor,Canvas,Fontasyncdefmain():blank=Canvas((200,100),'black')editor=Editor(blank)font=Font.poppins('bold',200)awaiteditor.text((20,20),'Quick Example',font)awaiteditor.save('example.png','PNG')awaiteditor.show()asyncio.run(main())Discord Bot Exampleimportdiscordfromdiscord.extimportcommandsfromaioEasyPillowimportEditor,Canvas,Font,load_imageintents=discord.Intents.default()intents.members=True# don't forget to activate this in the dev portal# You can of course also use the discord.Bot() or commands.Bot() classbot=commands.Bot(command_prefix='!',intents=intents)@bot.command()asyncdefcircle(ctx):# Load the image using `load_image`image=awaitload_image(ctx.author.display_avatar.url)# Initialize the editor and pass image as a parametereditor=Editor(image)# Simply circle the imageawaiteditor.circle_image()# Creating a discord.File object from the editors image_bytes, the image must not be savedfile=discord.File(fp=editor.image_bytes,filename='circle.png')awaitctx.send('Your circled imagavatare',file=file)bot.run("TOKEN")
Package: aio-easy-rabbit
aio-easy-rabbitAn opinionated way to use RabbitMQ in Asyncio based frameworks.Installationto be continued ...Usage exampleSimple consumer example in a FastAPIfromfastapiimportFastAPIfromaio_easy_rabbit.connectionimport(connect_to_rabbitmq,start_listening_to_queue,)app=FastAPI()@rabbitmq_consumer("test_queue")asyncdeftest_consumer(message):print(message)@app.on_event("startup")asyncdefstartup_event():registry=ConsumerRegistry()rabbitmq_connection_string="amqp://guest:guest@localhost"app.state.rabbitmq_connection=awaitconnect_to_rabbitmq(rabbitmq_connection_string)forqueue_nameinregistry.get_registered_queues():asyncio.create_task(start_listening_to_queue(app.state.rabbitmq_connection,queue_name))Key component is theConsumerRegistrythat will manage state of all registered queues and their consuming functions.Note: Each decorated consumer will receive a raw string that needs to be serialized as pleased.Simple publisher example in FastAPIfromfastapiimportFastAPIfromaio_easy_rabbit.connectionimport(connect_to_rabbitmq)fromaio_easy_rabbit.producersimportRabbitMQPublisherapp=FastAPI()classMessage(BaseModel):message:str@app.post("/test/{queue_name}/")asyncdeftest_endpoint(queue_name:str,message:Message):awaitapp.state.rabbitmq_publisher.publish_message(queue_name,message)return{"message":"Message published"}@app.on_event("startup")asyncdefstartup_event():rabbitmq_connection_string="amqp://guest:guest@localhost"app.state.rabbitmq_connection=awaitconnect_to_rabbitmq(rabbitmq_connection_string)app.state.rabbitmq_publisher=RabbitMQPublisher(rabbitmq_connection_string)
Package: aioeasywebdav
This project started as a port of the requests-based EasyWebDAV (http://github.com/amnong/easywebdav) to asyncio on Python 3.5. It has
since been extended with additional features.FeaturesBasic authenticationCreating directories, removing directories and filesUploading and downloading filesDirectory listingSupport for client side SSL certificatesFragmented download (multiple chunks in simultaneous streams)MD5 checksum validation when used with OwnCloud/Nextcloud webdavProgress tracking/reporting via callback systemInstallationInstall using distribute:pip install aioeasywebdavQuick Startimport aioeasywebdav
loop = asyncio.get_event_loop()

# Start off by creating a client object. Username and
# password may be omitted if no authentication is needed.
webdav = aioeasywebdav.connect('webdav.your-domain.com', username='myuser', password='mypass')

# Do some stuff:
loop.run_until_complete(webdav.mkdir('some_dir'))
loop.run_until_complete(webdav.rmdir('another_dir'))

async def fn():
    await webdav.download('/remote/path/to/file', '/local/target/file')
    await webdav.upload('/local/path/to/file', '/remote/target/file')
loop.run_until_complete(fn())Client object APIThe API is pretty much self-explanatory:cd(path)
ls(path=None)
exists(remote_path)
mkdir(path, safe=False)
mkdirs(path)
rmdir(path, safe=False)
delete(file_path)
upload(local_path_or_fileobj, remote_path)
download(remote_path, local_path)Using clientside SSL certificatewebdav = aioeasywebdav.connect('secure.example.net',
                               username='user',
                               password='pass',
                               protocol='https',
                               cert="/path/to/your/certificate.pem")
# Do some stuff:
print(await webdav.ls())Please note that all options and restriction regarding the “cert”
parameter fromRequests
APIapply here as
the parameter is only passed through!Developing aioEasyWebDAVWorking with a virtual environment is highly recommended:virtualenv --no-site-packages aioeasywebdav_dev
source aioeasywebdav_dev/bin/activateInstalling the library in development-mode:EASYWEBDAV_DEV=1 python setup.py developThe first part of the command causes setup.py to install development
dependencies, in addition to the normal dependencies.Running the tests:nosetests --with-yanc --nologcapture --nocapture testsRunning the tests with WebDAV server logs:WEBDAV_LOGS=1 nosetests --with-yanc --nologcapture --nocapture -v tests
Package: aioec
An aiohttp-based client for theEmote Collector API.Usageimportaioecanonymous_client=aioec.Client()authenticated_client=aioec.Client(token='your token here')local_client=aioec.Client(base_url='http://ec.localhost:2018/api/v0')# no trailing slash!# this step isn't necessary but makes sure that your token is correctmy_user_id=awaitclient.login()# it returns the user ID associated with your token# in a coroutine...emote=awaitclient.emote('Think')emote.name# Thinkawaitemote.edit(name='Think_',description='a real happy thinker')# remove the description:awaitemote.edit(description=None)forgamewisp_emoteinawaitclient.search('GW'):awaitgamewisp_emote.delete()all_emotes=[emoteasyncforemoteinclient.emotes()]popular_emotes=awaitclient.popular()awaitclient.close()# it's also a context manager:asyncwithaioec.Client(token=my_token)asclient:awaitclient.delete('Think_')# this will automatically close the clientWith the Tor hidden servicesYou’ll need to installaiohttp_socksfirst.fromaiohttp_socksimportSocksConnectorimportaioecconnector=SocksConnector(port=9050,rdns=True)# without rdns, the connector will fail to resolve onionsclient=aioec.Client(connector=connector,base_url='http://emotesdikhisgxdcmh7wtlvzfw2yxp4vmkyy6mu5wixzgqfmxvuotryd.onion/api/v0',)LicenseMIT/X11Copyright © 2018–2019 Io Mintz <io@mintz.cc>
Package: aioecobee
aioecobeePython3 async library for interacting with the ecobee APIRequirements:aiofiles, aiohttp, asyncioInstall aioecobee withpython3 -m pip install aioecobee.Usageaioecobee's main class is EcobeeAPI; create an API object like this:fromaiohttpimportClientSessionfromaioecobeeimportEcobeeAPIsession=ClientSession()api_key=xxxxxxxxxxxxxxxxxxxxxconfig_file="/path/to/ecobee.conf"ecobee=EcobeeAPI(session,api_key=api_key,config_file=config_file)Where:sessionis an instance of aiohttp.ClientSession();api_keyis the API key obtained from ecobee.com (optional); and,config_fileis the name of a config file for use with aioecobee (optional).If config_file is not specified, api_key is required.Obtain a PIN for authorizing on ecobee.com:awaitecobee.request_pin()After authorizing your app on ecobee.com, request tokens:awaitecobee.request_tokens()After obtaining tokens, populate (or update) ecobee.thermostats and ecobee.sensors:awaitecobee.update()Calls to the API will raise an ExpiredTokensError if tokens are expired and need refreshing:fromaioecobeeimportExpiredTokensErrortry:awaitecobee.update()exceptExpiredTokensError:awaitecobee.refresh_tokens()example.pyAn example script is provided to demonstrate the usage of aioecobee.pythonexample.pyapi_keyCaveatsaioecobee does not implement timeouts; use asyncio_timeout in your client code to wrap calls to the API as needed.ContributingPlease open issues or pull requests.
Package: aioeeveemobility
aioeeveemobilityAsynchronous library to communicate with the EEVEE Mobility APIAPI Example"""Test for aioeeveemobility."""fromaioeeveemobilityimportEeveeMobilityClientimportasyncioimportjsonimportaiohttpasyncdefmain():client=EeveeMobilityClient("user@email.com","yourpassword",)try:user=awaitclient.request("user")print(f"Hello{user.get('first_name')}")fleets=awaitclient.request(f"user/{user.get('id')}/fleets")forfleetinfleets:forentityinfleet.get('fleet').get('entities'):ifentity.get('id')==fleet.get('entity_id'):breakprint(f"Fleet:{fleet.get('fleet').get('name')},{entity.get('name')}| Payout rate:{fleet.get('payout_rate').get('rate')}{fleet.get('payout_rate').get('currency_code')}{fleet.get('payout_rate').get('suffix')}")cars=awaitclient.request(f"cars")forcarincars:print(f"Your car:{car.get('display_name')}{car.get('license')}")addresses=awaitclient.request(f"cars/{car.get('id')}/addresses")print("Addresses:")foraddressinaddresses:print(f" >{address.get('name')}:{address.get('location')}")events=awaitclient.request(f"cars/{car.get('id')}/events")print("Events:")foreventinevents.get('data'):print(event)finally:awaitclient.close_session()asyncio.run(main())
Package: aioelasticsearch
info:elasticsearch-py wrapper for asyncioInstallationpipinstallaioelasticsearchUsageimportasynciofromaioelasticsearchimportElasticsearchasyncdefgo():es=Elasticsearch()print(awaites.search())awaites.close()loop=asyncio.get_event_loop()loop.run_until_complete(go())loop.close()FeaturesAsynchronousscrollimportasynciofromaioelasticsearchimportElasticsearchfromaioelasticsearch.helpersimportScanasyncdefgo():asyncwithElasticsearch()ases:asyncwithScan(es,index='index',doc_type='doc_type',query={},)asscan:print(scan.total)asyncfordocinscan:print(doc['_source'])loop=asyncio.get_event_loop()loop.run_until_complete(go())loop.close()ThanksThe library was donated byOcean S.A.Thanks to the company for contribution.