Saravanan666/pypi-org huggingface dataset:
Package: aiocrossref
aiocrossrefAsynchronous client for CrossRef APIExampleimportasynciofromaiocrossrefimportCrossrefClientasyncdefworks(doi):client=CrossrefClient()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: aio_crud_store
A very simple subset of databases capabilities intended to use most of dbs
the same way. You can use it to write database independent asyncio
libraries.It currently supports mongodb (throughmotor) and postrgresql
(throughaiopg), please feel free to add other dbs implementations.Installpip install aio_crud_storeUsageThe api is very simple and obvious (I hope).
The working examples are inexamplesdirectory.# createid=awaitstore.create({'foo':'bar'})# readdoc=awaitstore.read(foo='bar')# updateawaitstore.update(id,{'foo':'baz','spam':1})# deleteawaitstore.delete(id)
Package: aiocryptocurrency
aiocryptocurrencyProvides a single abstract interface for managing the funds of various
cryptocurrency wallets via their RPC interfaces.Support for:This project currently supports the following coins:MoneroWowneroFiroQuick startpip install aiocryptocurrencyExample usingFiro(the API is the same for other coins).importasynciofromaiocryptocurrency.coins.neroimportWownero,Monerofromaiocryptocurrency.coins.firoimportFiroasyncdefmain():# ./firod -testnet -rpcbind=127.0.0.1 -rpcallowip=127.0.0.1 -rpcport=18888 -rpcuser=admin -rpcpassword=adminfiro=Firo()firo.port=18888firo.basic_auth=('admin','admin')# create a new receiving addressblob=awaitfiro.create_address()address=blob['address']# # list incoming txstxs=awaitfiro.list_txs(address)fortxintxs:print(tx.txid)# send paymentdest='TRwRAjxfAVKVZYQGdmskZRDSBw9E5YqjC8'amount=0.05txid=awaitfiro.send(dest,amount)loop=asyncio.get_event_loop()loop.run_until_complete(main())
Package: aiocryptopay
@cryptobotasynchronous api wrapperDocs:https://help.crypt.bot/crypto-pay-apiMainNet -@CryptoBotTestNet -@CryptoTestnetBotInstallpipinstallaiocryptopay
poetryaddaiocryptopayBasic methodsfromaiocryptopayimportAioCryptoPay,Networkscrypto=AioCryptoPay(token='1337:JHigdsaASq',network=Networks.MAIN_NET)profile=awaitcrypto.get_me()currencies=awaitcrypto.get_currencies()balance=awaitcrypto.get_balance()rates=awaitcrypto.get_exchange_rates()print(profile,currencies,balance,rates,sep='\n')Create, get and delete invoice methodsfromaiocryptopayimportAioCryptoPay,Networkscrypto=AioCryptoPay(token='1337:JHigdsaASq',network=Networks.MAIN_NET)invoice=awaitcrypto.create_invoice(asset='TON',amount=1.5)print(invoice.bot_invoice_url)# Create invoice in fiatfiat_invoice=awaitcrypto.create_invoice(amount=5,fiat='USD',currency_type='fiat')print(fiat_invoice)old_invoice=awaitcrypto.get_invoices(invoice_ids=invoice.invoice_id)print(old_invoice.status)deleted_invoice=awaitcrypto.delete_invoice(invoice_id=invoice.invoice_id)print(deleted_invoice)# Get amount in crypto by fiat summamount=awaitcrypto.get_amount_by_fiat(summ=100,asset='TON',target='USD')invoice=awaitcrypto.create_invoice(asset='TON',amount=amount)print(invoice.bot_invoice_url)Create, get and delete check methods# The check creation method works when enabled in the application settingsfromaiocryptopayimportAioCryptoPay,Networkscrypto=AioCryptoPay(token='1337:JHigdsaASq',network=Networks.MAIN_NET)check=awaitcrypto.create_check(asset='USDT',amount=1)print(check)old_check=awaitcrypto.get_checks(check_ids=check.check_id)print(old_check)deleted_check=awaitcrypto.delete_check(check_id=check.check_id)print(deleted_check)WebHook usagefromaiohttpimportwebfromaiocryptopayimportAioCryptoPay,Networksfromaiocryptopay.models.updateimportUpdateweb_app=web.Application()crypto=AioCryptoPay(token='1337:JHigdsaASq',network=Networks.MAIN_NET)@crypto.pay_handler()asyncdefinvoice_paid(update:Update,app)->None:print(update)asyncdefcreate_invoice(app)->None:invoice=awaitcrypto.create_invoice(asset='TON',amount=1.5)print(invoice.bot_invoice_url)asyncdefclose_session(app)->None:awaitcrypto.close()web_app.add_routes([web.post('/crypto-secret-path',crypto.get_updates)])web_app.on_startup.append(create_invoice)web_app.on_shutdown.append(close_session)web.run_app(app=web_app,host='localhost',port=3001)
Package: aiocrypto-prices
# aiocrypto_pricesVery early version - API WILL CHANGE!If you happen to stumble upon this library, please provide any and all feedback
through any means comfortable to you.## Install$ pipenv install aiocrypto_pricesor$ pip install aiocrypto_prices –user## UsageBehind the scenes we are (currently) using cryptocompare’s API,
which means all of the symbols need to be in their format and supported
by them.### Simple`python >> from aiocrypto_prices import currencies >> awaitcurrencies.ETH.prices.get('USD')1053.28 `### AdvancedUseful for loading things in parallel.Careful, if you’re not accessing the target price throughget,
it might not reload after cache expires`python >> from aiocrypto_prices import currencies >>currencies.add('BTC','ETH', 'IOT') >> await currencies.load_all() >> currencies.IOT.prices.USD 2.79 `### Setting up extra options`python >>> from aiocrypto_prices import currencies >>> currencies.cache = 120  # 2 minute cache >>>currencies.target_currencies.append('EUR')# In addition to defaults, let's fetch EUR too. >>> currencies.extra_information = True # Get name and url of a logo `or`python >>> from aiocrypto_prices import Currencies >>> currencies = Currencies(cache=120,target_currencies=['USD','EUR'],extra_information=True) `## Changelog### 0.0.3extra_information parameter was renamed to humannew paramter ‘full’ providing market cap and supplyMore data should be provided with ‘full’, but requires a redesign of Prices class## TODOall the TODOs scattered around the codeAll the available information cryptocompare offersAssign amount in that currency? - perhaps aiocrypto_folio?Implement adding together currencies of the same symbol and possibly other interactionsaiocrypto_exchangesaiocrypto_pools
Package: aiocse
aiocseAn asynchronous wrapper for theGoogle Custom Search JSON APIwritten in Python.
This is basically a copy ofasync-csewith some modifications.Features100% asynchronous (non-blocking)Toggle safe-search on/offImage searchTotal resultsMax resultsQuery timeInstallationThis library can be installed through PyPi:pipinstall-UaiocseYou can also install through GitHub:pipinstall-Ugit+https://github.com/Daudd/aiocseGetting StartedAn API key is required for aiocse, which you can get one fromhere. Keep in mind that one key is limited to 100 requests per day, so consider getting more than one key and put them in a list.
Package: aiocurl
handle=aiocurl.Curl()handle.setopt(aiocurl.URL,'https://example.com')awaithandle.perform()How?Using libcurl'ssocket interfaceto let asyncio's event loop do all the work ofwaiting for I/Oandscheduling of timeouts.multi_socket supports multiple parallel transfers — all done in the same single thread — and have been used to run several tens of thousands of transfers in a single application. It is usually the API that makes the most sense if you do a large number (>100 or so) of parallel transfers.This setup allows clients to scale up the number of simultaneous transfers much higher than with other systems, and still maintain good performance. The "regular" APIs otherwise waste far too much time scanning through lists of all the sockets.More examples?Awaiting multiple transfersUse any of asyncio's functions:awaitasyncio.gather(handle1.perform(),handle2.perform(),)Even better:multi=aiocurl.CurlMulti()awaitasyncio.gather(multi.perform(handle1),multi.perform(handle2),)Advantages of using a multi handle:connection reusemultiplexingshared SSL session and DNS cachePausing and resuming a transferSimply use the existing pause method:handle.pause(aiocurl.PAUSE_ALL)And to resume:handle.pause(aiocurl.PAUSE_CONT)For more pause options seelibcurl's documention.Stopping a tranferThe opposite of perform:handle.stop()And if the transfer is performed by a multi handle:multi.stop(handle)A stopped perform will returnNoneinstead of the finished handle:ifawaithandle.perform():print('finished')else:print('stopped')Cancelling a transferThis is just like stop(), except the corresponding perform() coroutine will be
cancelled instead:try:awaithandle.perform()exceptasyncio.CancelledError:print('cancelled')DependenciesPycURL 7.43.0.4 or above. It has essential fixes that make event-driven transfers work. Older releases fail to relay libcurl's event messages.(optional)Additional PycURLevent-related fixesthat make pausing and resuming of transfers work.Licenseaiocurl - asyncio extension of PycURL
Copyright (C) 2021  fsbs

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

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
Package: aiocycletls
CycleTLS Wrapper - convenient, fast, no bansMinimal information  before start usingpip3installaiocycletlsAfter install you must get build from my repository  or create own for your system. (repository CycleTLS)This project working with proxy on low-level of Go networkSome exampleimportaiocycletlsasyncdefmain()->None:proxy=aiocycletls.WSProxyClient()response=awaitproxy.request(url="https://tools.scrapfly.io/api/fp/ja3?extended=1",method="GET",user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",ja3=aiocycletls.JA3.CHROME_107)print(response.jsonable_body())# You see your JA3 <3
Package: aiodagpi
An asynchronous python API wrapper for Dagpi :https://dagpi.xyzInstallationInstall via pip, either directly from PyPI:>>>python3-mpipinstall-Uaiodagpior from the github repository:>>>python3-mpipinstall-Ugit+https://github.com/DevilJamJar/aiodagpiAlternatively, download files directly fromdownload files. This is not recommended and can cause directory issues later down the line if not placed and constructed correctly. If you must, usethis guidefor help on how to install python packages.UsageExamplesAuthorsaiodagpiwas written byRaj Sharma.dagpi.xyzwas constructed byDaggy1234.
Package: aiodanbooru
Danbooru is a Python library that provides an easy-to-use interface for
interacting with the Danbooru API. It allows you to search for posts,
retrieve post details, and download media files from the Danbooru image
board.FeaturesSimple and intuitive API for interacting with the Danbooru APIRetrieve posts based on tags and limitDownload media files (images, videos) associated with the postsSupports asynchronous requests using aiohttpInstallationYou can install Danbooru using pip:pipinstallaiodanbooruUsageHereвЂ™s a simple example that demonstrates how to use the Danbooru
library:fromaiodanbooru.apiimportDanbooruAPIasyncdefmain():api=DanbooruAPI(base_url="https://danbooru.donmai.us")posts=awaitapi.get_posts(tags=["cat_girl","solo"],limit=10)ifposts:post=posts[0]media_data=awaitpost.get_media()withopen(post.filename,"wb")asfile:file.write(media_data)print("Media file saved!")if__name__=="__main__":importasyncioloop=asyncio.get_event_loop()loop.run_until_complete(main())For more details and advanced usage examples, please refer to thedocumentation.ContributingContributions are welcome! If you have any suggestions, bug reports, or
feature requests, please open an issue on theGitHub
repository. Feel free to
submit pull requests with improvements or fixes.LicenseThis project is licensed under the MIT License. See theLICENSEfile for more information.
Package: aiodav
Python Async WebDAV ClientA asynchronous WebDAV client that useasyncioBased onwebdavclient3InstallationWe periodically publish source code and wheelson PyPI.$pipinstallaiodavFor install the most updated version:$gitclonehttps://github.com/jorgeajimenezl/aiodav.git
$cdaiodav
$pipinstall-e.Getting startedfromaiodavimportClientimportasyncioasyncdefmain():asyncwithClient('https://webdav.server.com',login='juan',password='cabilla')asclient:space=awaitclient.free()print(f"Free space:{space}bytes")asyncdefprogress(c,t):print(f"{c}bytes /{t}bytes")awaitclient.download_file('/remote/file.zip','/local/file.zip',progress=progress)asyncio.run(main())LicenseMIT License
Package: aiodbm
An AsyncIO bridge for Python’s DBM library.Descriptionaiodbm is a library that allows you to use DBM in asyncio code.Full coverage of Python’s DBM and GDBM APITyping supportDocstrings and documentationFully testedWhy use aiodbm?DBMis a fast and easy to use, embedded key-value store.
It is supported by Python’s standard library[1]and can be used on most systems without requiring additional dependencies[2].Compared to Sqlite - the other embedded database supported by Python’s standard library - it is significantly faster when used as key/value store.In our measurements we see that aiodbm is hundreds or times faster for writes and more then three faster for reads compared to aiosqlite[3]:So if you are on a Linux system and need a fast and an easy to use embedded key-value store for asyncio, aiodbm can be a good solution.CaveatsOn non Linux-like systems DBM is usually not available and Python will fall back on it’s “dumb” DBM implementation. While DBM’s core functionality still works, that implementation is be much slower.Python’s DBM library is not process safe. If you need a key-value store in a multi process context (e.g. a web server running with gunicorn) we’d recommend to use Redis or something similar instead.UsageHere is a basic example on how to use the library:importasyncioimportaiodbmasyncdefmain():# opening/creating databaseasyncwithaiodbm.open("example.dbm","c")asdb:# creating new key alpha with value greenawaitdb.set("alpha","green")# fetching value for key alphavalue=awaitdb.get("alpha")print(value)# delete key alphaawaitdb.delete("alpha")asyncio.run(main())InstallationYou can install this library directly from PyPI with the following command:pipinstallaiodbmReference[1]See also Python’s DBM module:https://docs.python.org/3/library/dbm.html[2]The newer DBM variants GDBM or NDBM are preinstalled on most Linux/Unix systems:https://en.wikipedia.org/wiki/DBM_(computing)#Availability[3]We compared asyncio compatible key/value stores on Linux with GDBM. See also measurements folder for more details.
Package: aiodcard
aiodcard==============Dcard crawler using asyncio(coroutine)Feature-------| Get article list and content using coroutineDependencies------------* Python 3.3 and :mod:`asyncio` or Python 3.4+* aiohttpInstallation------------::python setup.py installor::pip install aiodcardExample-------::import asyncioimport aiohttpimport aiodcard@asyncio.coroutinedef get_funny_articles():session = aiohttp.ClientSession()forum_name = 'funny'page_index = 1result = yield from aiodcard.get_articles_of_page(session, forum_name, page_index)print(result)def main():loop = asyncio.get_event_loop()loop.run_until_complete(get_funny_articles())if __name__ == '__main__':main()Todo----* test all functionsAuthors and License-------------------The ``aiodcard`` package is written by Chien-Wei Huang. It’s MIT licensed and freely available.Feel free to improve this package and send a pull request to GitHub.
Package: aioddd
Async Python DDD utilities libraryaioddd is an async Python DDD utilities library.InstallationUse the package managerpipto install aioddd.pipinstallaiodddDocumentationVisitaioddd docs.Usagefromasyncioimportget_event_loopfromdataclassesimportdataclassfromtypingimportTypefromaiodddimportNotFoundError,\Command,CommandHandler,SimpleCommandBus,\Query,QueryHandler,OptionalResponse,SimpleQueryBus,Event_products=[]classProductStored(Event):@dataclassclassAttributes:ref:strattributes:AttributesclassStoreProductCommand(Command):def__init__(self,ref:str):self.ref=refclassStoreProductCommandHandler(CommandHandler):defsubscribed_to(self)->Type[Command]:returnStoreProductCommandasyncdefhandle(self,command:StoreProductCommand)->None:_products.append(command.ref)classProductNotFoundError(NotFoundError):_code='product_not_found'_title='Product not found'classFindProductQuery(Query):def__init__(self,ref:str):self.ref=refclassFindProductQueryHandler(QueryHandler):defsubscribed_to(self)->Type[Query]:returnFindProductQueryasyncdefhandle(self,query:FindProductQuery)->OptionalResponse:ifquery.ref!='123':raiseProductNotFoundError.create(detail={'ref':query.ref})return{'ref':query.ref}asyncdefmain()->None:commands_bus=SimpleCommandBus([StoreProductCommandHandler()])awaitcommands_bus.dispatch(StoreProductCommand('123'))query_bus=SimpleQueryBus([FindProductQueryHandler()])response=awaitquery_bus.ask(FindProductQuery('123'))print(response)if__name__=='__main__':get_event_loop().run_until_complete(main())RequirementsPython >= 3.7ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: aiodebug
This is a tiny library for monitoring and testing asyncio programs.
Its monitoring features are meant to be always on in production.Installationaiodebugis only compatible with Python 3.8 and higher. There are no plans to support older versions.aiodebugisavailable on PyPIand you can install it with:pip install aiodebugorpoetry add aiodebugaiodebugwill uselogwoodif it is installed, otherwise it will default
to the standard logging module.Log warnings when callbacks block the event loopimportaiodebug.log_slow_callbacksaiodebug.log_slow_callbacks.enable(0.05)This will produce WARNING-level logs such asExecuting <Task pending coro=<foo() running at /home/.../foo.py:37>
wait_for=<Future pending cb=[Task._wakeup()]>> took 0.069 secondsasyncio already does this in debug mode, but you probably don’t want to enable full-on debug mode in production.Instead of defaulting to the logs, you may provide your own callback that gets called with the name of the
slow callback and its execution duration, and can do anything it needs with it. This might be useful
e.g. for structured JSON logging.importaiodebug.log_slow_callbacksaiodebug.log_slow_callbacks.enable(0.05,on_slow_callback=lambdatask_name,duration:json_logger.warning('Task blocked async loop for too long',extra={'task_name':task_name,'duration':duration}))Track event loop lags in StatsDimportaiodebug.monitor_loop_lagaiodebug.monitor_loop_lag.enable(statsd_client)Tracks how much scheduled calls get delayed and sends the lags to StatsD.Dump stack traces of all threads if the event loop hangs for too longimportaiodebug.hang_inspectiondumper=aiodebug.hang_inspection.start('/path/to/output/directory',interval=0.25)# 0.25 is the default...awaitaiodebug.hang_inspection.stop_wait(dumper)Enabling this function may help you in case one of your threads (sometimes) runs a CPU-bound operation that
completely stalls the event loop, but you don’t know which thread it is or what it is doing.Every time the event loop hangs (doesn’t run a scheduled ‘monitoring’ task) for longer than the giveninterval, aiodebug will create 3 stack traces, 1 second apart, in your output directory.
For example:-rw-r--r--  1 user  group   6.7K  4 Jan 09:41 stacktrace-20220104-094154.197418-0.txt
-rw-r--r--  1 user  group   7.0K  4 Jan 09:41 stacktrace-20220104-094155.206574-1.txt
-rw-r--r--  1 user  group   6.6K  4 Jan 09:41 stacktrace-20220104-094156.211781-2.txtEach file then contains the Python stack traces of all threads that were running or waiting at the time.
You might be able to find your culprit blocking the event loop at the end of one of the traces.Speed up or slow down time in the event loopThis is mainly useful for testing.importaiodebug.testing.time_dilated_looploop=aiodebug.testing.time_dilated_loop.TimeDilatedLoop()asyncio.set_event_loop(loop)loop.time_dilation=3awaitasyncio.sleep(1)# Takes 0.333s of real timeloop.time_dilation=0.1awaitasyncio.sleep(1)# Takes 10s of real timeaiodebugwas made byQuantlane, a systematic trading firm.
We design, build and run our own stock trading platform.
Package: aiodec
aiodecDecorators for asyncioContentsaiodecastopwatchastopwatchTheastopwatchdecorator is used in the following way:fromaiodecimportastopwatch@astopwatchasyncdefblah(x,y):returnx+yWhat does it do? This simple decorator will emit logs with the following message:INFO:aiodec:Time taken: 0.0003 secondsNot terribly special. Yet. You can also customize the log message:fromaiodecimportastopwatch@astopwatch(message_template='Time cost was $time_ sec',fmt='%.1g')asyncdefblah(x,y):returnx+yThis outputs log messages with the following message:INFO:aiodec:Time cost was 3e-4 secTwo things: first, the template parameter used for the time cost is called$time_; second, you can customize the formatting of the seconds value.
However, it can also do something a lot more interesting: it can include
parameters from the wrapped function in the message:fromaiodecimportastopwatch@astopwatch(message_template='x=$x y=$y | $time_ seconds')asyncdefblah(x,y=2):returnx+yloop.run_until_complete(blah(1))This outputs log messages with the following message:INFO:aiodec:x=1 y=2 | 0.0003 secondsMagic! Note that positional args and keyword args and default values
are all handled correctly.As you saw earlier, in addition to the function parameters, the special$time_parameter will also be available. The other extra fields are:$name_, which contains the__name__of the wrapped function, and$qualname_, which contains the__qualname__of the wrapped function.These three template parameters have a trailing underscore, to avoid collisions
with any parameter names.