Saravanan666/pypi-org huggingface dataset:
Package: asyncsteampy
AsyncsteampyThis library is a soft fork ofbukson/steampy⚠ and created only to provide asynchronous methods and proxies support.Docs, examples you can read from originalREADME. Differences of usage and new features listed below 📖Must work with python 3.6 and above like origin, but tested only on3.10⚡NavigationInstallationLogin&InitAsyncIOProxy supportTestsInstallationpipinstallasyncsteampy

pipenvinstallasyncsteampy

poetryaddasyncsteampyLogin&InitNow you don't need to passusername,password,steamguardargs tologinmethod, you can do this in constructor.fromasyncsteampy.clientimportSteamClientasAsyncSteamClientasync_steam_client=AsyncSteamClient('MY_USERNAME','MY_PASSWORD','PATH_TO_STEAMGUARD_FILE/STEAMGUARD_DICT',api_key="API_KEY")Instead of passingstrpath orpathlib.Pathtosteamguard.txtfile or even json serialized string you can just use
dict object:steamguard={"steamid":"YOUR_STEAM_ID_64","shared_secret":"YOUR_SHARED_SECRET","identity_secret":"YOUR_IDENTITY_SECRET",}AsyncIOAll methods that require connection to steam network now have asyncio support (it
usesaiohttp) and are asynchronous :client,market,chat.fromasyncsteampy.clientimportSteamClientasAsyncSteamClientasync_steam_client=AsyncSteamClient('MY_USERNAME','MY_PASSWORD','PATH_TO_STEAMGUARD_FILE/STEAMGUARD_DICT',api_key="API_KEY")awaitasync_steam_client.login()buy_order_id="some_buy_order_id"response=awaitasync_steam_client.market.cancel_buy_order(buy_order_id)# do other async workawaitasync_steam_client.close(logout=True)If you end your operations, ⚠️keep in mind, you always need to close yourasync_steam_client. This will
dologout(iflogout=True)
and closeaiohttpsessionproperly. Also,
you canawait async_steam_client.logout()without closing session if you need this for some reason.Async context manager usage example:fromasyncsteampy.clientimportSteamClientasAsyncSteamClientasyncwithAsyncSteamClient('MY_USERNAME','MY_PASSWORD','PATH_TO_STEAMGUARD_FILE/STEAMGUARD_DICT',api_key="API_KEY")asasync_steam_client:awaitasync_steam_client.do_what_you_need()There you don't need to callclose, async context manager do it automatically when execution passes the block of code.Proxy supportIf your proxy type is socks4/5 you should look at this small but precious
libraryaiohttp-socks, if proxy type http/https, or you don't
likeaiohttp-socksyou can useaiohttp-proxyinstead.importaiohttpfromaiohttp_socksimportProxyConnectorfromasyncsteampy.clientimportSteamClientasAsyncSteamClientconnector=ProxyConnector.from_url('proxy_type://proxy_url_with_or_no_auth')session_with_proxy=aiohttp.ClientSession(connector=connector)# Finally, pass session object in AsyncSteamClientasync_steam_client=AsyncSteamClient(...,session=session_with_proxy)asyncwithAsyncSteamClient(...,session=session_with_proxy)asasync_steam_client:...TestsTo run tests clone repo, install with dev dependenciespoetryinstallCreate env variables listed intests/dataand runpytestfrom project dir:pytest
Package: async-storages
Async storagesAsync file storages for PythonInstallationInstallasync_storagesusing PIP or poetry:pipinstallasync_storages# orpoetryaddasync_storagesFeaturessimple abstraction over local filesystem, s3, or memory driverS3 integrationSpooled In-memory driver for unit testsQuick startSee example application inexamples/directory of this repository.
Package: async-stripe
async-stripeAn asynchronous wrapper around Stripe's official python library.How it worksasync-stripe monkey-patches the stripe library and replaces the synchronous
http request methods with asynchronous methods.Monkey-patching allows us to avoid a complete rewrite and keep the usage api
similar to the official library.Thisdoesn't use threads, butactual async coroutinesandnon-blocking http clientto make requests. Hence, the performance is much
better than other wrapper libraries which use threading.InstallInstall requires Python 3.6 or newer.$pipinstallasync-stripeUsageThe usage api is similar to Stripe's official library:fromasync_stripeimportstripestripe.api_key='<stripe-secret-key>'payment_intent=awaitstripe.PaymentIntent.create(amount=1000,currency='usd')print(payment_intent.id)/!\ Note:Since this library monkey-patches the actualstripelibrary,
you should avoid using the two in the same process.Once you importasync_stripe, the officialstripelibrary gets patched with
async methods and the original synchronous api won't be available.ConfigurationPlease seestripe-python's READMEfile for configuring logging and other things.Unsupported configurations:async-stripeaims to be a drop-in async replacement forstripe. However,
there are a few things which are not yet supported:Custom http client: Currently, it's not possible to configure a
custom http client and Tornado'sAsyncHTTPClientwill be used by default.Proxy: Connecting to api via a proxy is not supported yet.Development and TestingWhen adding new features and monkey-patches, please add relevant tests and
ensure that all the tests also pass.In most cases, you shouldn't need to write the tests yourself: you can just
copy-paste the tests form the original stripe library and change the synchronous
methods to asynchronous methods.For testing, first,install and run thestripe-mockapi server.Next, installpytest,pytest-mockandpytest-asynciopython packages in
your virtualenv.Finally, run the tests like this:$pytesttests# or run a specific test$pytesttests/api_resources/test_customer.py
$pytesttests/api_resources/test_customer.py::TestCustomerLicenseA lot of the code (especially tests) are copied with slight modifications from
Stripe's official library. That code is licensed underMIT License.Rest of the original code is licensed underBSD-3-Clause License.
Package: async-suds
---------------------------------------Lightweight SOAP client (Kamyar's fork).---------------------------------------Based on the original 'suds' project by Jeff Ortel (jortel at redhatdot com) hosted at 'http://fedorahosted.org/suds'.'Suds' is a lightweight SOAP-based web service client for Pythonlicensed under LGPL (see the LICENSE.txt file included in thedistribution).This is hopefully just a temporary fork of the original suds Pythonlibrary project created because the original project development seemsto have stalled. Should be reintegrated back into the original projectif it ever gets revived again.
Package: async-suds-v7k
Lightweight SOAP client (Kamyar's fork).Based on the original 'suds' project by Jeff Ortel (jortel at redhat
dot com) hosted at 'http://fedorahosted.org/suds'.'Suds' is a lightweight SOAP-based web service client for Python
licensed under LGPL (see the LICENSE.txt file included in the
distribution).This is hopefully just a temporary fork of the original suds Python
library project created because the original project development seems
to have stalled. Should be reintegrated back into the original project
if it ever gets revived again.
Package: asynct
AsynctTable of ContentsOverviewUsageOverviewThis package uses threading to create a simple future-like async interface for functions.UsageTo make a function async you can use themake_asynctdecorator:@make_asynct# Now this function won't block the main thread when ran.deffunc():...You can then use the result of the function (which is an asynct object) - either asynchronously or synchronously:func_asynct=func()@func_asynct.thendefdoes_something_with_the_result(result):...@does_something_with_the_result.thendefdoes_another_thing_with_the_result(result):...# orresult=func_asynct.await_it()# ...
Package: async-tail
async-tailAsynchronous tailing library written in Rust.Python wrapper around Rustlinemuxlibrary, which uses thenotifycross-platform filesystem notification library.UsesPyO3Rust bindings andPyO3-asyncioto manage Rust/Python event loops lifecycles.Installationasync-tailrequires Python 3.7 - 3.11.pipinstallasync-tailBinaries are available for:Linux:x86_64,aarch64,i686,armv7l,musl-x86_64,musl-aarch64,ppc64le&s390xMacOS:x86_64&arm64(except python 3.7)Windows: To be doneOtherwise, you can install from source which requires Rust stable to be installed.UsageHere are some examples of whatasync-tailcan do:tailUsagefromasync_tailimporttailforlineintail('./path/to/file.log','./path/to/file_2.log'):print(line)atailUsageimportasynciofromasync_tailimportatailasyncdefmain():asyncforlineinatail('/path/to/file.txt','/path/to/file_2.txt'):print(line)asyncio.run(main())Notesasync-tailis a way for me to learn Rust and experiment Rust bindings from Python. It is inspired from the greatSamuel COLVIN's work onwatchfiles, which provides a Python wrapper around Rustnotifycrate. This is still under development. More things will come:Write testsSetup proper CIBuild wheels for WindowsBuild and expose docsProvide benchmarks
Package: asynctask
# asynctask[![Build Status](https://api.travis-ci.org/listen-lavender/asynctask.svg?branch=master)](https://api.travis-ci.org/listen-lavender/asynctask)Best practice of celery.## celery app connection settingasynctask/setting.py## task connection settingasynctask/db.py# Getting startedNo example now.## InstallationTo install asynctask, simply:````bash$ cd asynctask$ python setup.py install````````bash$ celery -A asynctask worker --loglevel=info````````python>>> from asynctask.unit.project.test import add, insert>>> add()>>> insert()>>> add.apply_async()>>> insert.apply_async()````or````python>>> from asynctask.celery import send_task>>> send_task('asynctask.unit.project.test.add')````````mongo> use test> db.resource.find()````## Discussion and supportReport bugs on the *GitHub issue tracker <https://github.com/listen-lavender/asynctask/issues*.
Package: async-task-helpers
async_task_helpersSimple asynchronous task helpersHow to installpipinstallasync_task_helpersFeaturesLoop tasksfromasync_task_helpersimportloop@loop(minutes=5,seconds=30)asyncdefloop_example():# This LoopTask will run in every 5 minute and 30 seconds.awaitsome_async_task()awaitsome_async_task2()Asynchronous Callbacksimportasynciofromasync_task_helpersimportasync_callback_handlerasyncdefuniverse_last_answer():print('Universe`s a whole and entire, final answer is...')awaitasyncio.sleep(1)print('42!')return42asyncdefasync_callback(result):awaitasyncio.sleep(5)print(f'I got the result of{result}!')task=asyncio.create_task(async_callback_handler(universe_last_answer,async_callback),name='Async Callback Test')
Package: async-task-queue
async-task-queueIn-memory FIFO queue for concurrent task execution. Used to execute tasks concurrently with optional control (via semaphore) over the max number of tasks running at the same time.Features:Queue processing summary loggingIntrospection of failed, retried, and succeeded tasksTask retries (optional)Task execution timeout (optional)Queue processing with semaphore (optional)Batch size control (optional)TOC:InstallationGuideDevelopmentInstallationasync-task-queue requires Python 3.6 or above.pipinstallasync-task-queueGuideimportloggingfromasync_task_queueimportAsyncTask,AsyncTaskQueue# Initialize a loggerlogger=logging.getLogger("foo")# Initialize an AsyncTaskQueue where:#   - At most 5 tasks are running concurrently#   - Number of tasks executing concurrently should be limited by a semaphore#   - Failed tasks should be retried (default behavior)#   - Executing the tasks queued should timeout and be cancelled after 5 minutestask_queue=AsyncTaskQueue(logger,use_semaphore=True,batch_size=5,execution_timeout=300)# Add async tasks to the queuetask_queue.enqueue([AsyncTask(some_coroutine,*args,**kwargs)forargs,kwargsinsome_args_kwargs])# Start processing the queueawaittask_queue.execute()DevelopmentTo develop async-task-queue, install dependencies and enable the pre-commit hook:pipinstallpre-committox
pre-commitinstallTo run tests:tox
Package: asynctasks
Task scheduler based on asyncio. Allows max-concurrency and granularity to be specified. Execution results are printed as a Gantt chart.Sample Usagefromasynctasks.executorimportExecutorfromasynctasks.executionplanimportExecutionPlanimportasyncio#create an array of taskstasks_dict_array=[{"dependencies":[],"name":"task0"},{"dependencies":[0],"name":"task1"},{"dependencies":[1],"name":"task2"},{"dependencies":[0],"name":"task3"},{"dependencies":[],"name":"task4"},{"dependencies":[],"name":"task5"}]#define an async function that should be executed for each taskasyncdefprint_task(loop,task):print("Executing task{}".format(task))awaitasyncio.sleep(0.1)#create an execution plan for the tasksplan=ExecutionPlan().from_dict_array(tasks_dict_array)print("\nBEFORE EXECUTION\n{}".format(plan))#execute the plan with print_task function and max_concurrency as 2Executor(plan,2,0.01,print_task).trigger_execution()print("\nAFTER EXECUTION\n{}".format(plan.as_gantt()))Sample OutputBEFOREEXECUTIONtask0Readytask1task2task3task4Readytask5ReadyExecutingtask{'dependencies':[],'name':'task0','start_time':1497528994.1246588}Executingtask{'dependencies':[],'name':'task4','start_time':1497528994.1246588}Executingtask{'dependencies':[0],'name':'task1','start_time':1497528994.236074}Executingtask{'dependencies':[0],'name':'task3','start_time':1497528994.2370954}Executingtask{'dependencies':[1],'name':'task2','start_time':1497528994.340769}Executingtask{'dependencies':[],'name':'task5','start_time':1497528994.3417716}AFTEREXECUTION....................................................................................................task0...............................task1.............................task2................................task3.............................task4...............................task5...............................
Package: asynctb
asynctbis a library that helps you get tracebacks of parts of your
running Python program. It was originally designed with async tasks in
mind (thus the name), but also has some support for threads, greenlets,
and ordinary synchronous code. It is loosely affiliated with theTrioasync framework, and shares Trio’s
obsessive focus on usability and correctness. You don’t have to use it
with Trio, though; its only package dependency isattrs.This is mostly intended as a building block for other debugging and
introspection tools. You can use it directly, but there’s only
rudimentary support for end-user-facing niceties such as
pretty-printed output. On the other hand, the core logic is
extremely flexible:Tracebacks can be extracted for generators (regular and async),
coroutine objects, greenlets, threads, and ranges of frame objects.Other awaitables can be handled by defining an “unwrapper”, which
takes an awaitable of that type and returns a coroutine or generator.
Several are supported out of the box, for async generatorasend()andathrow()methods andcoroutine_wrapperobjects.
Third-party packages can add more.Tracebacks can include information about what context managers are
active in each frame, including references to the context manager
objects themselves. For example, this can be used to draw a
detailed Trio task tree. The logic knows how to look inside@contextmanager,ExitStack, and their async equivalents
(both those in the stdlib and their popular backports inasync_generatorandasync_exit_stack).
Third-party packages can define context manager unwrappers too.There are a number of customization points allowing third-party
packages to specify that some of their functions and/or those
functions’ callees should be excluded fromasynctbtracebacks,
or should incorporate the traceback of another object thatasynctbknows how to handle. For example, the traceback of a
Trio task blocked intrio.to_thread.run_sync()could cover the
code that’s running in the thread as well.And of course, if you want to disable all of this and just have a
version ofinspect.stack()that takes a coroutine object, you can.asynctbrequires Python 3.6 or later. It is tested with CPython
(every minor version through 3.10-dev) and PyPy, on Linux, Windows,
and macOS. It will probably work on other operating systems.
Basic features will work on other interpreters, but the context
manager decoding will be less intelligent, and won’t work at all
without a usablegc.get_referents().This is still in development. It has full test coverage, but
will likely undergo some incompatible API changes before an initial
release. Documentation is also currently light. Watch this space!License: Your choice of MIT or Apache License 2.0
Package: asynctelegraf
asynctelegrafAsyncio python client forTelegraf, compatible with AWS cloudwatch metrics (statsd)InstallpipinstallasynctelegrafExampleimportasynciofromasynctelegrafimportTelegrafClienttelegraf=TelegrafClient(host='127.0.0.1',port=8125,batch_size=100)@telegraf.timed('magic.time',use_ms=True)asyncdefdo_some_magic():awaitasyncio.sleep(3.3)return'Magic'asyncdefmain():asyncwithtelegraf.start():res=awaitdo_some_magic()print("result",res)asyncio.run(main())ContributionsIf you have found a bug or have some idea for improvement feel free to create an issue or pull request.LicenseApache 2.0
Package: asynctempfile
asynctempfileAsync interface for the standard tempfile module.  Implements the following
4 classes:TemporaryFileNamedTemporaryFileSpooledTemporaryFileTemporaryDirectoryBlocking methods are delegated to threadpools using loop.run_in_executor().
Non-blocking methods and properties retain a sync interface.  SpooledTemporaryFile only delegates if the in-memory stream is rolled to
disk.  New instances of the above classes return wrapped with a context
manager allowing use with async with and async for.Installationpip install asynctempfileCreditAn extension of github.com/Tinche/aiofilesExamplesimport asynctempfile

async with asynctempfile.TemporaryFile('wb+') as f:
    await f.write(b'Hello, World!')import asynctempfile

async with asynctempfile.NamedTemporaryFile('wb+') as f:
    await f.write(b'Line1\n Line2')
    await f.seek(0)
    async for line in f:
        print(line)DependenciesaiofilesRelease Notes0.5.0Adjusted TemporaryDirectory to return its path as opposed to the object when used with a context manager, aligning behaviour with the sync library (thank you to hellocoldworld).Fixed name attribute for TemporaryFile as this property is now included in the aiofiles wrapper.
Package: async-tensorart
AsyncTensorArtAsynchronous wrapper for the TensorArt APIasync_tensorartis a Python package for asynchronous access to
theTensorArtAPI.Installationpipinstallasync-tensorartUsageimportasynciofrompathlibimportPathfromaiohttpimportClientSessionfromasync_tensorartimportTensorArtfromasync_tensorart.signatureimportPrivateKeyasyncdefmain():# Create a TensorArt clienttensor=TensorArt(app_id="APP_ID",endpoint="ENDPOINT",session=ClientSession(),private_key=PrivateKey(path=Path("private_key.pem")),)# Get model infomodel_info=awaittensor.get_model(model_id=42)print(model_info)asyncio.run(main())LicenseThis project is licensed under the terms of the MIT license.
Package: asyncthreads
The asyncthreads module provides common threading design patterns and utilities
needed for asynchronous and multithreaded programming.  This includes a thread
pool and a reactor, which together combine to create a highly reliable
concurrent event processing system.Project LinksDownloads:http://pypi.python.org/pypi/asyncthreadsDocumentation:https://bitbucket.org/agillis/asyncthreads/wiki/HomeProject page:https://bitbucket.org/agillis/asyncthreadsLicense:http://www.opensource.org/licenses/mit-license.phpInstallationUsing pipMake sure python-pip is installed on you system.  If you are using virtualenv, then pip is alredy installed into environments created by vertualenv.  Run pip to install asyncthreads:pip install asyncthreadsFrom SourceThe asyncthreads package is installed from source using distutils in the usual way.  Download thesource distributionfirst.  Un-tar the source tarball and run the following to install the package site-wide:python setup.py installUsageUsing the ThreadPool and Reactor is as simple as creating an instance and submitting work:r = Reactor(ThreadPool(MIN_SIZE, MAX_SIZE))
r.start()
r.call(handle_event, (transport, event_id))
r.call_later(300, five_min_sync_check, (param1, param2))
r.call_in_thread(background_task)
r.call_in_thread_later(600, ten_min_async_check, (param1, param2))
r.shutdown()See thedocumentationfor details.For example usage, look in theexamplesandtestdirectories insrc.RequirementsPython 2.7 or greaterDevelopment ToolsDevelopment tools are only required for doing development work and running
tests.mercurialpy.testpycheckerBugs and Issueshttp://bitbucket.org/agillis/asyncthreads/issues/
Package: async-throttle
Async ThrottleMultipurpose concurrency primitive forasynciocoroutines.FeaturesThis throttle is configured with two related, but different parameters:Throttle(capacity:float,concurrency:int=0,period:float=1.0)capacity- Sets therate limitfor requests, ascapacityperperiodseconds.concurrency- The number of jobs that can be executing at a given time.Usually, servers will set policies on both of these dimensions, and will suspend clients that violate either of them.Throttle#pause(td: int)Thepausemethod will lock the throttle for the given number of seconds.For example, if an API bans your client from accessing resources due to violating their rate-limit, you can tell your code to sleep for a period of time and try again later.UsageThe throttle can be a drop-in replacement for another primitive likeasyncio.Semaphore.
In fact, it's really just anasyncio.Semaphore(which handles theconcurrencylimit) mixed with a token bucket to provide rate limiting.throttle=Throttle(10,2)# Two concurrent coros limited to 10qps (total).# Perform one task when the budget allowsasyncwiththrottle:# Do some (async) thing# For tasks that should consume more of the budget, you can call the throttle:asyncwiththrottle(5):# Do some more expensive thing, equivalent to 5 requestsLike otherasyncioprimitives,Throttleis not thread-safe.
Package: async-thumbnail
Offload sorl thumbnail rendering to a render view.Installationpipinstallasync-thumbnailUsageNoteMake sure you havesorl thumbnailsconfigured.# settings.pyINSTALLED_APPS=(# ...'async_thumbnail',# ...)# urls.pyurlpatterns=[# ...path('',include('async_thumbnail.urls')),# ...]{% load async_thumbnail %}<!-- Default --><imgsrc="{% async_thumbnail object.image "900x600"crop="center"%}"><!-- Save as var -->{% async_thumbnail object.image "900x600" crop="center" as im %}<imgsrc="{{ im.url }}"width="{{ im.width }}"height="{{ im.height }}">FetchFromCacheMiddlewareWhen you use the default full page caching middleware, it may be a good idea
to replace it with this middleware. This prevents cache from being updated when
the content contains a render URL.WarningIn case you’re using things likesource setsor lazy loading techniques this may be a bad idea.# settings.pyMIDDLEWARE=('django.middleware.cache.UpdateCacheMiddleware',# ...'async_thumbnail.middleware.FetchFromCacheMiddleware',)SettingsASYNC_THUMBNAIL_ENDPOINTDefault:''Optional setting to determine an absolute path for rendering.ASYNC_THUMBNAIL_PATTERN_NAMEDefault:'async_thumbnail:render'Pattern name for render URL’s.