Saravanan666/pypi-org huggingface dataset:
Package: aioflows
aioflowsAsynchronous actors frameworkDocumentation:https://aioflows.github.ioSource:https://github.com/apatrushev/aioflowsThis project aims to create a support library for constructing asynchronous applications in Python, using the concept of structured data flows and actors. The current phase is purely a proof-of-concept and serves as a basis for discussion with colleagues and the community. It is not intended for use in any production or personal projects.Minimal working exampleimportasynciofromaioflows.simpleimportPrinter,Tickerasyncdefstart():await(Ticker()>>Printer()).start()asyncio.run(start())Udp echo exampleimportasynciofromaioflows.networkimportUdpfromaioflows.simpleimportPrinter,Teeasyncdefstart():udp=Udp(local_addr=('127.0.0.1',5353),reuse_port=True)await(udp>>Tee(Printer())>>udp).start()asyncio.run(start())You can test it with socat:socat-UDP:localhost:5353Other examplesMore examples can be found insrc/examples.Installationlocalpipinstall.editablepipinstall-e.developmentpipinstall-e.[dev]examples dependenciespipinstall-e.[examples]all togetherpipinstall-e.[dev,examples]from githubpipinstallgit+https://github.com/apatrushev/aioflows.gitUsual development stepsRun checks and tests:invisortflaketestRun examples (all ERRORCODE's should be 0/OK or timeout at the moment):invexamples|grepERRORCODESimilar projectsI found existing solutions that are almost equal to this concept:https://github.com/ReactiveX/RxPYhttps://github.com/vxgmichel/aiostream
Package: aiofluent-python
aiofluentAn asynchronous fluentd client libary. Inspired byfluent-logger-pythonRequirementsPython 3.5 or greatermsgpackasync-timeoutInstallationpip install aiofluent-pythonExampleimportasynciofromaiofluentimportFluentSendersender=FluentSender()asyncdefgo():awaitsender.emit('tag',{'name':'aiofluent'})awaitsender.close()asyncio.run(go())
Package: aio-fluid
Tools for backend python servicesInstallationThis is a simple python package you can install via pip:pip install aio-fluidModulesschedulerA simple asynchronous task queue with a schedulerkernelAsync utility for executing commands in sub-processesAWSpackages for AWS interaction are installed viaaiobotocores3fs(which depends on aiobotocore and therefore versions must be compatible)boto3is installed as extra dependency of aiobotocore so versioning is compatible
Package: aio-framework
A Python website bot development framework (WIP)IntroductionThis project was created to aid the development of website bots and API
wrappers.aio-frameworkhandles task management and execution,
session management, and captcha queue management (with threads!).
Currently, captcha queue management supports 2Captcha.aio-frameworkis meant to decrease development time by providing common bot and API
wrapper functionality.Basic UsageThis module is available via pip:$ pip install aio-frameworkBasicApiWrapperandBotimplementations are shown below.Botimplementationsmustimplement theexecute_taskmethod.ApiWrapper# exampleapiwrapper.pyfromaioimportApiWrapperclassExampleApiWrapper(ApiWrapper):BASE_URL='https://example.com'defget_product_data(self,product_url):response=self.get(product_url)returnresponse.json()['data']# Or somethingdefadd_product_to_cart(self,product_data,captcha_token):payload={'product_data':product_data,'captcha':captcha_token}endpoint='/add-to-cart'response=self.post(endpoint,data=payload)returnresponse.json()['success']# Or somethingBot# examplebot.pyfromaioimportBotfromaio.captchaimportCaptchaManagerfromexampleapiwrapperimportExampleApiWrapperclassExampleBot(Bot):defexecute_task(self,task):example_api_wrapper=ExampleApiWrapper()twocaptcha_api_token='2CAPTCHA_API_TOKEN_HERE'site_key='SITE_KEY_HERE'page_url='PAGE_URL_HERE'captcha_manager=CaptchaManager(twocaptcha_api_token,site_key,page_url)captcha_manager.start_captcha_queue(num_threads=5)task.status='STARTED'product_url=task.data['product_url']task.logger.info('Getting product data')product_data=example_api_wrapper.get_product_data(product_url)task.logger.info('Got product data!')task.logger.info('Waiting for captcha token')captcha_token=captcha_manager.wait_for_captcha_token()task.logger.info('Got captcha token!')task.logger.info('Adding product to cart')added=example_api_wrapper.add_product_to_cart(product_data,captcha_token)task.logger.info('Added product to cart!')task.status='FINISHED'Executing# main.pyfromaioimportTaskfromexamplebotimportExampleBotexample_bot=ExampleBot()task_data={'product_url':'https://example.com/product'}task=Task(task_data)example_bot.add_task(task)example_bot.start_all_tasks()
Package: aiofreepybox
aiofreepyboxEasily manage your freebox in Python using the Freebox OS API.
Check your calls, manage your contacts, configure your dhcp, disable your wifi, monitor your LAN activity and many others, on LAN or remotely.aiofreepybox is a python library implementing the freebox OS API. It handles the authentication process and provides a raw access to the freebox API in an asynchronous manner.This project is based on fstercq/freepybox, which provides the same features as aiofreepybox in a synchronous manner.InstallUse the PIP package manager$pipinstallaiofreepyboxOr manually download and install the last version from github$gitclonehttps://github.com/stilllman/aiofreepybox.git
$pythonsetup.pyinstallGet started# Import the aiofreepybox package.fromaiofreepyboximportFreepyboxasyncdefreboot()# Instantiate the Freepybox class using default options.fbx=Freepybox()# Connect to the freebox with default options.# Be ready to authorize the application on the Freebox.awaitfbx.open('192.168.0.254')# Do something useful, rebooting your freebox for example.awaitfbx.system.reboot()# Properly close the session.awaitfbx.close()Have a look at theexample.pyfor a more complete overview.Notes on HTTPSWhen you access a Freebox with its default-assigned domain (ending infbxos.fr), the library verifies its certificate by automatically trusting the Freebox certificate authority. If you want to avoid this, you cansetup a custom domain namewhich will be associated with a Let's Encrypt certificate.ResourcesFreebox OS API documentation :http://dev.freebox.fr/sdk/os/
Package: aiofreqlimit
AboutFrequency limit context manager for asyncio.Installationaiofreqlimit requires Python 3.8 or greater and is available on PyPI. Use pip to install it:pipinstallaiofreqlimitUsing aiofreqlimitPass a value of any hashable type toacquireor do not specify any parameter:importasynciofromaiofreqlimitimportFreqLimitlimit=FreqLimit(1/10)asyncdefjob():asyncwithlimit.acquire('some_key'):awaitsome_call()asyncdefmain():awaitasyncio.gather(job()for_inrange(100))asyncio.run(main())
Package: aiofunctools
aiofunctoolsLibrary to help in Python functional programing. It’s asyncio compatible.Basic idea behind it isRailway Oriented Programing.This allows us to:simplify our code.improve error management.be cool! be functional!Examples:Old code example:asyncdefcreate_user_handler(request)->Response:try:user=check_valid_user(request)create_user(user)exceptInvalidBody:return_422('Invalid body')exceptUserAlreadyExists:return_409('User already exists')return_201(user)ROP example:asyncdefcreate_user_handler(request)->Response:returnawaitcompose(check_valid_user,create_user,return_201)(request)
Package: aiofutures
AiofuturesGeneral informationInstallationUsageImplicit initialization (global executor)Explicit initializationUVLoopNotesContributionGeneral informationaiofuturesprovides tools to integrate an asynchronous code into your synchronous
application in a usual and easy way using standard library'sconcurrent.futures.Executorinterface.It may be useful when you want to:smoothly migrate your synchronous codebase to asynchronous styledecrease a number of threads in your applicationReplace this:fromconcurrent.futuresimportThreadPoolExecutorwithThreadPoolExecutor()asex:future=ex.submit(sync_task)result=future.result()With this:fromaiofuturesimportAsyncExecutorwithAsyncExecutor()asex:future=ex.submit(async_task)result=future.result()The former spawns a lot of threads and experiences all cons of GIL, the latter
spawns the only one async thread (check outnotes)InstallationYou can installaiofuturesusing pip:pip install aiofuturesUsageImplicit initialization (global executor)Set an environment variableAIOFUTURES_INITto any value and use shortcuts from the library:os.environ.setdefault('AIOFUTURES_INIT','1')fromaiofuturesimportrun_asyncasyncdefio_bound_task(seconds):awaitasyncio.sleep(seconds)returnsecondsfuture=run_async(io_bound_task,5)print(future.result())AIOFUTURES_INITimplicitly initializes a globalAsyncExecutorand gives you an option to use
shortcutsrun_asyncandsync_to_async.Explicit initializationUse an instance of theAsyncExecutordirectly:fromaiofuturesimportAsyncExecutorexecutor=AsyncExecutor()future=executor.submit(io_bound_task,5)print(future.result())In cases when you need to do IO synchronously within async tasks, you can usesync_to_async:fromaiofuturesimportAsyncExecutor,sync_to_asyncexecutor=AsyncExecutor()asyncdefio_bound_task():# or with the shortcut# url = await sync_to_async(fetch_url_from_db_sync)url=awaitexecutor.sync_to_async(fetch_url_from_db_sync)data=awaitfetch_data(url)returndatafuture=executor.submit(io_bound_task)print(future.result())NOTE: You can use sync_to_async within tasks running in the executor only.UVLoopTo use with the high performanceuvloopinstall it before initialization:# install before the import for the global executorimportuvloopuvloop.install()fromaiofuturesimportrun_async...# or before an explicit initializationimportuvloopfromaiofuturesimportAsyncExecutoruvloop.install()executor=AsyncExecutor()NotesTake into account that asyncio still (CPython3.11)
resolves DNS in threads, not asynchronouslyAny blocking function will block the whole AsyncExecutorContributionAll suggestions are welcome!
Package: aioga
aiogainfo:Google Analytics client for asyncioInstallationpipinstallaiogaUsageimportasyncioimportuuidfromaiogaimportGATRACKING_ID='XX-XXXXXXXX-X'asyncdefgo():cid=uuid.uuid4()asyncwithGA(TRACKING_ID)asga:ga.event(str(cid),ec='tests',ea='success from context manager')# all methods returns asynio.Tasks, which can be awaited if neededloop=asyncio.get_event_loop()loop.run_until_complete(go())loop.close()DocumentationThe library is asynchronous client for measurement protocol.
All available hit types are supported.Full documentationof measurement protocol provides by googleAvailable methodspageviewscreenvieweventtransactionitemsocialexceptiontimingAvailable parametersAll methods require cid (Client ID). The value of this field
should be a random UUID (version 4) as described inhttp://www.ietf.org/rfc/rfc4122.txtLibrary support all available parametes for measurement protocol
(documentationhere)
Package: aiogaro
AIOGaroAsynchronous library to access Garo ChargeboxesThis library is under developmentRequires Python >= 3.9, uses asyncio and aiohttpUsageInexample.py, you find the simplest usage of the library. You need two things to use the library:IP number of the ChargeboxSerial number of the ChargeboxYou find the IP number in two ways:accessing your router and determine which IP the Chargebox has been given from DHCPLog in tohttp://chargebox.webel.se/with serial number and password and see where you get redirected.Developed with the intention to be used with Home Assistant.
Package: aiogbchat
Async Client-Server chat written in python.=================Quick start-------.. code::pip install aiogbchat --upgrade  # installpython -m aiogbserver  -- nogui  # run server in console modepython -m aiogbclient            # run client in GUI modeDocumentation:-------`<https://achicha.github.io/chat/>`_Known issues:-------* client disconnected with some logged issues (DB/asyncio). its not critical :)* windows: client doesn't work in console mode.* windows8 and higher: only works with pyqt5==5.9.2* testsHelpful:-------* How to generate docs:.. code::pip install sphinxsphinx-apidoc -f ../../chat -o /some_dir/docs/sourcemake html* How to deploy to pypi:.. code::pip install twinepython3 setup.py bdist_wheel # generate wheeltwine upload dist/*Links:-------* `Add sphinx pages to github <https://daler.github.io/sphinxdoc-test/includeme.html>`_
Package: aiogc
aiogcAsync Google Calendar API Client for Python 3InstallationRun this in your terminal:pip install aiogcUsageFollowing code prints summary andstartandenddatetimes of upcoming events within nearest 5 days.importasyncioimportdatetimeimportaiohttpfromaiogcimportevents,modelsc=models.Credentials(client_id='<your_client_id>',client_secret='<your_client_secret>',scopes=['<your_scope1>','your_scope2'],refresh_token='<your_refresh_token>')asyncdefmain():asyncwithaiohttp.ClientSession()ass:es=awaitevents.list(calendar_id='<your_calendar_id>',credentials=c,session=s,singleEvents='true',timeMin=datetime.datetime.now().isoformat(),timeMax=(datetime.datetime.now()+datetime.timedelta(days=5)).isoformat(),orderBy='startTime',)foreines:print(f'{e.summary}:\n{e.start.dateTime}–{e.end.dateTime}')if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(main())
Package: aiogeoip
Real asynchronousgeolocation by IP address withAsyncio support.Get the geolocation of IPsasynchronouslyorsynchronouslyusing theIP-APIservice withcachedrequests for greater optimization of your software, providing back end withurllibandrequests.Docs+Pip+Multiplataform+CHANGELOGChangelog0.0.2 (02-10-2020)FeaturesIf a request is not successful (return code 200) it will be
tried again byNset by default to3in a time interval
in secondsNby default2.
You can still call thegeoipfunction only with a mandatory
IPv4 argument, so it will have the default behavior of trying 3 times.BugfixesAll backends deal with theconnection errorand return code429error.Improved DocumentationCreation of the page to document the synchronous functions.MiscBasic tests forgeoipfunction on all backends0.0.3 (14-10-2020)Bugfixes#2ModuleNotFoundError: No module named 'ujson'0.0.4 (17-10-2020)Features#3function that returns the external IP address, private IP and hostname.Misc#4Support to python3.4+Improved DocumentationFunctiongeoipin aio, requests and urllib background. Improved documentation for the Geolocation class.
Package: aio-geojson-client
python-aio-geojson-clientThis library provides convenient async access toGeoJSONFeeds.Installationpip install aio-geojson-clientKnown ImplementationsLibrarySourceTopicaio_geojson_generic_clientGeneric GeoJSON feedsAnyaio_geojson_geonetnz_quakesGeoNet New Zealand QuakesEarthquakesaio_geojson_geonetnz_volcanoGeoNet New Zealand VolcanoVolcanoesaio_geojson_nsw_rfs_incidentsNSW Rural Fire ServiceFiresaio_geojson_usgs_earthquakesU.S. Geological Survey Earthquake Hazards ProgramEarthquakesUsageEach implementation extracts relevant information from the GeoJSON feed. Not
all feeds contain the same level of information, or present their information
in different ways.After instantiating a particular class and supply the required parameters, you
can callupdateto retrieve the feed data. The return value will be a tuple
of a status code and the actual data in the form of a list of feed entries
specific to the selected feed.
Alternatively, calling methodupdate_overrideallows passing in ad-hoc filters
that override the globally defined filters.Status CodesOK: Update went fine and data was retrieved. The library may still
return empty data, for example because no entries fulfilled the filter
criteria.OK_NO_DATA: Update went fine but no data was retrieved, for example
because the server indicated that there was not update since the last request.ERROR: Something went wrong during the updateFeed ManagerThe Feed Manager helps managing feed updates over time, by notifying the
consumer of the feed about new feed entries, updates and removed entries
compared to the last feed update.If the current feed update is the first one, then all feed entries will be
reported as new. The feed manager will keep track of all feed entries'
external IDs that it has successfully processed.If the current feed update is not the first one, then the feed manager will
produce three sets:Feed entries that were not in the previous feed update but are in the
current feed update will be reported as new.Feed entries that were in the previous feed update and are still in the
current feed update will be reported as to be updated.Feed entries that were in the previous feed update but are not in the
current feed update will be reported to be removed.If the current update fails, then all feed entries processed in the previous
feed update will be reported to be removed.After a successful update from the feed, the feed manager provides two
different dates:last_updatewill be the timestamp of the last update from the feed
irrespective of whether it was successful or not.last_update_successfulwill be the timestamp of the last successful update
from the feed. This date may be useful if the consumer of this library wants
to treat intermittent errors from feed updates differently.last_timestamp(optional, depends on the feed data) will be the latest
timestamp extracted from the feed data.
This requires that the underlying feed data actually contains a suitable
date. This date may be useful if the consumer of this library wants to
process feed entries differently if they haven't actually been updated.
Package: aio-georss-client
python-aio-georss-clientThis library provides convenient async access toGeoRSSFeeds.Installationpip install aio-georss-clientKnown ImplementationsLibrarySourceTopicaio_georss_gdacsGlobal Disaster Alert and Coordination System (GDACS)Natural DisastersUsageEach implementation extracts relevant information from the GeoJSON feed. Not
all feeds contain the same level of information, or present their information
in different ways.After instantiating a particular class and supply the required parameters, you
can callupdateto retrieve the feed data. The return value will be a tuple
of a status code and the actual data in the form of a list of feed entries
specific to the selected feed.Status CodesOK: Update went fine and data was retrieved. The library may still
return empty data, for example because no entries fulfilled the filter
criteria.OK_NO_DATA: Update went fine but no data was retrieved, for example
because the server indicated that there was not update since the last request.ERROR: Something went wrong during the updateGeometry FeaturesThis library supports 3 different types of geometries:PointPolygonBounding BoxBy default each feed entry is using all available geometries from the external
feed. If required however, you can exclude geometries by overriding
FeedEntry#features and only return the geometries you want to support in your
specific implementation.Feed ManagerThe Feed Manager helps managing feed updates over time, by notifying the
consumer of the feed about new feed entries, updates and removed entries
compared to the last feed update.If the current feed update is the first one, then all feed entries will be
reported as new. The feed manager will keep track of all feed entries'
external IDs that it has successfully processed.If the current feed update is not the first one, then the feed manager will
produce three sets:Feed entries that were not in the previous feed update but are in the
current feed update will be reported as new.Feed entries that were in the previous feed update and are still in the
current feed update will be reported as to be updated.Feed entries that were in the previous feed update but are not in the
current feed update will be reported to be removed.If the current update fails, then all feed entries processed in the previous
feed update will be reported to be removed.After a successful update from the feed, the feed manager provides two
different dates:last_updatewill be the timestamp of the last update from the feed
irrespective of whether it was successful or not.last_update_successfulwill be the timestamp of the last successful update
from the feed. This date may be useful if the consumer of this library wants
to treat intermittent errors from feed updates differently.last_timestamp(optional, depends on the feed data) will be the latest
timestamp extracted from the feed data.
This requires that the underlying feed data actually contains a suitable
date. This date may be useful if the consumer of this library wants to
process feed entries differently if they haven't actually been updated.
Package: aiogetui
aiogetuiPython SDK for Getui push service based on asyncio(aiohttp).
Based onGeTui rest api.Installation$pipinstallaiogetuiBasic UsageimportasyncioimportuuidfromaiogetuiimportIGeTui,ToSingleMessage,NotificationTemplateAPP_ID=''APP_KEY=''MASTER_SECRET=''CLIENT_ID=''asyncdefrun():client=IGeTui(APP_ID,APP_KEY,MASTER_SECRET)awaitclient.auth_sign()message=ToSingleMessage(client_id=CLIENT_ID,template=NotificationTemplate({'title':'my title','text':'My text.'}),is_offline=True,# optional, default to Falsemessage_id=uuid.uuid4().hex,# optional, length 10~32)result=awaitclient.push(message)print(result)awaitclient.close()asyncio.get_event_loop().run_until_complete(run())
Package: aiogithubapi
aiogithubapiAsynchronous Python client for the GitHub APIThis is not a full client for the API (Have you seen it, it's huge), and will probably never be.
Things are added when needed or requested.If something you need is missing please raisea feature request to have it addedorcreate a PR 🎉.For examples on how to use it see thetests directory.Installpython3-mpipinstallaiogithubapiProject transitionNote: This project is currently in a transition phase.In august 2021 a new API interface was introduced (in#42). With that addition, all parts of the old interface is now considered deprecated.
Which includes:Theaiogithubapi.commonmoduleTheaiogithubapi.legacymoduleTheaiogithubapi.objectsmoduleAll classes starting withAIOGitHubTheasync_call_apifunction in theaiogithubapi.helpers.pyfileTheGitHubDeviceclass inaiogithubapi, replaced withGitHubDeviceAPITheGitHubclass inaiogithubapi, replaced withGitHubAPILater this year (2022), warning logs will start to be emitted for deprecated code.Early next year (2023), the old code will be removed.ContributeAllcontributions are welcome!Fork the repositoryClone the repository locally and open the devcontainer or use GitHub codespacesDo your changesLint the files withmake lintEnsure all tests passes withmake testEnsure 100% coverage withmake coverageCommit your work, and push it to GitHubCreate a PR against themainbranch
Package: aiogmailsender
This is an asynchronous Gmail client that can send emails currently.Quickstartimportasyncioimportloggingfromemail.mime.multipartimportMIMEMultipartfromemail.mime.textimportMIMETextimportaiogmailsenderasyncdefarun():sender=awaitaiogmailsender.create('<gmailusername>','<gamilpassword>',rate_limit=60,# How many emails sender sends within a minutepool_size=2,# How many clients are kept in poolretry=5,# How many times sender retries to send a message, when sending failsbackoff=30,# How long sender sleep before retry (unit. seconds)backoff_limit=300# Max backoff (everytime sender retries, the backoff time increases exponentially and the time can't be over this limit.))tasks=[]foriinrange(10):message=MIMEMultipart('alternative')message["From"]='test'message["To"]='<targetemail>'message["Subject"]=f'test{i}'part=MIMEText('test','html')message.attach(part)tasks.append(sender.send(message))awaitasyncio.gather(*tasks)if__name__=='__main__':logging.basicConfig(format="%(asctime)s%(levelname)s:%(name)s:%(message)s",level=logging.DEBUG)asyncio.run(arun())