Saravanan666/pypi-org huggingface dataset:
Package: aiops
Basic Utilities for aiops implementationsaiops is a library of basic utilities (including pretrained models/pipelines) for aiops implementations.aiopsextends PyTorch to provide text data processing functions.InstallationMake sure you have Python 3.6+ and PyTorch 1.0+. You can then installaiopsusing
pip:pipinstallaiopsAuthorsAmandeep- DeveloperCitingIf you find aiops useful for an academic publication, then please use the following BibTeX to cite it:@misc{pytorch-nlp,
  author = {Amandeep},
  title = {aiops: Basic utilities for aiops implementations},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/amandeep1991/aiops}},
}
Package: aiopslibscancer
IntroductionTODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.Getting StartedTODO: Guide users through getting your code up and running on their own system. In this section you can talk about:Installation processSoftware dependenciesLatest releasesAPI referencesBuild and TestTODO: Describe and show how to build your code and run the tests.ContributeTODO: Explain how other users and developers can contribute to make your code better.If you want to learn more about creating good readme files then refer the followingguidelines. You can also seek inspiration from the below readme files:ASP.NET CoreVisual Studio CodeChakra Core
Package: aio-pubsub
A generic interface wrapping multiple backends to provide a consistent pubsub API.Installationpipinstallaio-pubsub# for redis backendpipinstallaio-pubsub[aioredis]# for postgresql backendpipinstallaio-pubsub[aiopg]UsageTo use it, you need to implement your pubsub implementation from interfaces or use backends
fromaio_pubsub.backendspackagefromaio_pubsub.backends.memoryimportMemoryPubSubpubsub=MemoryPubSub()# Create subscribersubscriber=awaitpubsub.subscribe("a_chan")# Push messageawaitpubsub.publish("a_chan","hello world!")awaitpubsub.publish("a_chan","hello universe!")# And listening channeltry:asyncformessageinsubscriber:print(message,flush=True)exceptKeyboardInterrupt:print("Finish listening")Supported backendsDisclaimer: I would not advise you to use this backend, because it is shown only for testing purposes.
Better develop your own implementation.memoryredispostgresql
Package: aiopubsub-py3
aio_pubsub
########安装
==========.. code-block:: shellpip install aiopubsub-py3
pip install aiopubsub-py3[redis]示例
==========2.1 发布.. code-block:: pythonfrom aiopubsub import Pubsub

async def main():
    async with Pubsub(Pubsub.REDIS, port=16379, namespace="cs", role=PubsubRole.PUB) as pub:
        count = await pub.publish("foo", {"test": 1})
        print(count)
        count = await pub.publish("foo", {"test": 2})
        print(count)
        count = await pub.publish("foo", {"test": 3})
        print(count)2.2 订阅.. code-block:: pythonfrom aiopubsub import Pubsub, PubsubRole


async def print_msg(channel, msg):
    print(f"sub msg: {channel} -- {msg}")

async def main():
    channels = ["foo"]
    async with Pubsub(Pubsub.REDIS, port=16379, namespace="cs", role=PubsubRole.SUB) as sub:
        await sub.subscribe(*channels)
        async for k in sub.listen(handler=print_msg):
            print(k)
        await sub.unsubscribe(*channels)2.3 模糊订阅.. code-block:: pythonfrom aiopubsub import Pubsub

async def print_msg(channel, msg):
    print(f"psub msg: {channel} -- {msg}")

async def main():
    channels = ["foo*"]
    async with Pubsub(Pubsub.REDIS, port=16379, namespace="cs", role=PubsubRole.SUB) as psub:
        await psub.psubscribe(*channels)
        async for k in psub.listen(handler=print_msg):
            print(k)
        await psub.unsubscribe(*channels)2.4 自动识别角色【根据第一次调用函数决策，未close之前不能切换角色】.. code-block:: pythonfrom aiopubsub import Pubsub

async def print_msg(channel, msg):
    print(f"psub msg: {channel} -- {msg}")

async def main():
    channels = ["foo*"]
    pubsub = Pubsub(Pubsub.REDIS, port=16379, namespace="cs")
    await pubsub.publish("foo", {"test": 1})  # 角色设置为PUB，执行成功

    await pubsub.subscribe(*channels)  # 角色为PUB，无法订阅抛出异常

    await pubsub.close()  # 角色释放

    await pubsub.subscribe(*channels)  # 角色设置为SUB，执行成功

    print(pubsub.backend.role)

    await pubsub.publish("foo", {"test": 1})  # 角色为SUB，无法发布抛出异常

    async with pubsub:
        await pubsub.unsubscribe(*channels)  # 角色为SUB，执行成功
    # async with 退出作用域，角色释放

    await pubsub.publish("foo", {"test": 1})  # 角色设置为PUB，执行成功
Package: aiopulsar-py
aiopulsar-pyaiopulsar-pyis a Python 3.5+ module that makes it possible to interact with pulsar servers with asyncio.aiopulsar-pyserves as an asynchronous wrapper for theofficial python pulsar-clientand preserves the look and
feel of the original pulsar-client. It is written using the async/await syntax and hence not compatible with Python
versions older than 3.5. Internally, aiopulsar-py employs threads to avoid blocking the event loop.aiopulsar-pytakes inspiration from other asyncio wrappers released in theaio-libs project.Basic exampleaiopulsar-pyis built around thepython pulsar-clientand provides the same api. You just need to use asynchronous context managers and await for every method. Setting up a
pulsar client that can be used to create readers, producers and consumers requires a call to theaiopulsar.connectmethod.importasyncioimportaiopulsarimportpulsarasyncdeftest_example():topic="persistent://some-test-topic/"asyncwithaiopulsar.connect("localhost")asclient:asyncwithclient.subscribe(topic=topic,subscription_name='my-subscription',consumer_name="my-consumer",initial_position=pulsar.InitialPosition.Earliest,)asconsumer:whileTrue:msg=awaitconsumer.receive()print(msg)loop=asyncio.get_event_loop()loop.run_until_complete(test_example())Installaiopulsar-pycannot be installed on windows systems since the wrappedpulsar-clientlibrary only functions on Linux and MacOS.
The package is available on PyPi and can be installed with:pipinstallaiopulsar-pyContributingYou can contribute to the project by reporting an issue. This is done via GitHub. Please make sure to include
information on your environment and please make sure that you can express the issue with a reproducible test case.You can also contribute by making pull requests. To install the project please use poetry:poetryinstallThe project relies onmypy,blackandflake8and these are configured as git hooks.
To configure the git hooks run:poetryrungithookssetupEvery time the git hooks are changed in the[tool.githooks]section ofpyproject.tomlyou will need to set up
the git hooks again with the command above.
Package: aiopulse
AiopulseAsynchronous library to control Rollease Acmeda Automate roller blinds via a version 1 Pulse Hub.The Rollease Acmeda Pulse Hub is a WiFi hub that communicates with Rollease Acmeda Automate roller blinds via a proprietary RF protocol.
This module communicates over a local area network using a propriatery binary protocol to issues commands to the Pulse Hub.
A module that supports version 2 Pulse Hubs has been developed separately here:https://pypi.org/project/aiopulse2/This module requires Python 3.4 or newer and uses asyncio.InstallingAvailable on PyPi here:https://pypi.org/project/aiopulse/, runpip install aiopulse.
Alternatively, download and extract a release and from within the folder containing setup.py runpython setup.py install.Demo.py commands:CommandDescriptiondiscoverFind and connect to any hubs on the local network (uses udp broadcast discovery)connectConnect to all hubs and trigger updatedisconnectDisconnect all hubsupdateRefresh all information from hublistList currently connected hubs and their blinds, use to get the [hub id] and [blind id] for the following commands.open [hub id] [blind id]Open blindclose [hub id] [blind id]Close blindstop [hub id] [blind id]Stop blindmoveto [hub id] [blind id] [% closed]Open blind to percentagehealth [hub id] [blind id]Update the health of the blindlog [level]Set the log level to one of (critical,error,warning,info,debug)exitExit program
Package: aiopulse2
aiopulse2Asynchronous library to control Rollease Acmeda Automate roller blinds with the Pulse v2 HubThis is an updated fork ofaiopulsefor the v2 hub (note: this isnotcompatible with the v1 hub, useaiopulsefor that). The protocol implementation uses a combination of WebSockets and a TCP connection using a serial like protocol. See the project wiki page for details.Requires Python 3.7 or later and uses asyncio andwebsockets.It has been primarily developed as an integration forHome Assistant.InstallingRunpip install aiopulse2.Demo.pyThis is an interactive interface to test the integration. The available commands are listed below.Use thelistcommand to get the id of the hubs/blinds.CommandDescriptionconnect [hub ip][hub ip]...]Connect to the hub at ip(s)disconnectDisconnect all hubslistList currently connected hubs and their blinds, use to get the [hub id] and [blind id] for the following commands.open [hub id][blind id]Open blindclose [hub id][blind id]Close blindstop [hub id][blind id]Stop blindmoveto [hub id][blind id] [% closed]Open blind to percentageexitExit programpulse_hub_cli.pyThis is a trivial work-in-progress aiopulse2 command-line-interface wrapper.  It issues a command to a blind given the hub ip address, device name as defined in thePulse 2app and desired percentage closed.  It then waits for the command to complete.python3 pulse_hub_cli.py '192.168.1.127' 'Office 1 of 3' 100close.shThis is an example application of pulse_hub_cli.py.  It closes three blinds in sequence.  In this case, it is useful to close the blinds one at a time because they share a small power supply.python3 pulse_hub_cli.py '192.168.1.127' 'Office 1 of 3' 100
python3 pulse_hub_cli.py '192.168.1.127' 'Office 2 of 3' 100
python3 pulse_hub_cli.py '192.168.1.127' 'Office 3 of 3' 100
Package: aiopusher
aiopusherAn async library for subscribing to the Pusher WebSocket protocol.InstallationYou can installaiopushervia pip from PyPI:pipinstallaiopusherOr withPoetry:poetryaddaiopusherUsageHere are some examples of usingaiopusher:importasynciofromaiopusherimportPusherasyncdefmain():asyncwithPusher('<your-app-key>')asclient:channel=awaitclient.subscribe('<channel-name>')channel.bind('<event-name>',lambdadata:print(data))# Run forever (or until manually stopped)whileTrue:awaitasyncio.sleep(1)asyncio.run(main())Or, if you don't want to use context manager, you can useconnectanddisconnectmethods:asyncdefmain():client=Pusher('<your-app-key>')awaitclient.connect()channel=awaitclient.subscribe('<channel-name>')channel.bind('<event-name>',lambdadata:print(data))whileTrue:awaitasyncio.sleep(1)awaitclient.disconnect()# Yes, I know this cannot technically be reachedYou can also use decorators to bind events:importasynciofromaiopusherimportPusherclient=Pusher('<your-app-key>')@client.event('<channel-name>','<event-name>')asyncdefhandle_event(data):print(data)asyncdefmain():awaitclient.connect()# Run forever (or until manually stopped)whileTrue:awaitasyncio.sleep(1)asyncio.run(main())Connect to different endpoints:importasynciofromaiopusherimportPusherasyncdefmain():options={host:'api.example.com',# default: 'ws.pusherapp.com'"userAuthentication":{"endpoint":"/auth","transport":"ajax",}}asyncwithPusher('<your-app-key>',options)asclient:channel=awaitclient.subscribe('<channel-name>')channel.bind('<event-name>',lambdadata:print(data))# Run forever (or until manually stopped)whileTrue:awaitasyncio.sleep(1)asyncio.run(main())You can also make a singleton client, which can be accessed from anywhere in your code:importasynciofromaiopusherimportPusher,SingletonClientasyncdefmain():client=Pusher('<your-app-key>')SingletonClient.set_client(client)awaitclient.connect()channel=awaitSingletonClient.get_client().subscribe('<channel-name>')channel.bind('<event-name>',lambdadata:print(data))whileTrue:awaitasyncio.sleep(1)DevelopmentTo get started with development, you can clone the repository and install the dependencies.Poetryis used to manage the dependencies, so you can install it withpip install poetry(or follow the instructions on the Poetry website) and then runpoetry installto install the dependencies.TestingIf you want to run the tests locally, it should be known that the tests require multiple python versions to be installed. The easiest way to do this is to usepyenv.Once you have pyenv installed, you can runpyenv installto install the required versions of python (as specified in the.python-versionfile). Then, you can runnoxto run the tests.
Package: aiopvapi
AioPvApiA python asyncio API for PowerView blinds.
Written for Home-Assistant. Adding features as I go...Have a look at the examples folder for some guidance how to use it.Linkshttps://home-assistant.io/https://www.hunterdouglas.com/operating-systems/powerview-motorizationChangelogv1.6.19Add endpoints and handle 423 responseRemove loop as argumentv2.0.0Add support for all known shade typesFallback to shade recognition based on capabilityClamping to prevent MIN_POSITION or MAX_POSITION being exceededCode refactoringv2.0.1Invert type 3 & 4 to match api documentation from hunter douglasAdd type 10v2.0.2Bug Fix to handle shades with unexpected json responsesv2.0.3Add Type 26, 27 & 28 - Skyline PanelsForce capability 1 for Type 44 - TwistAlign class name standardv2.0.4Add Type 10 - SkyLiftHandle calls to update shade position during maintenanceRaise error directly on hub calls instead of loggerv3.0.0Major overhaul to incorporate gateway version 3 API.  Version can be automatically detected or manually specified.UserData class is deprecated and replaced with Hub.ShadePosition class now replaces the raw json management of shades in support of cross generational management.Schedules / Automations are now supported by the APINew get_objecttypemethods available to returned structured data objects for consistent managementv3.0.1Raw hub data updates made via defined function (request_raw_data,request_home_data,request_raw_firware,detect_api_version)Parse Gen 3 hub name based on serial + macFind API version based on firmware revisionRemove async_timeout and move to asynciov3.0.2Add type 19 (Provenance Woven Wood)Fix Positioning for ShadeVerticalTiltAnywhere + ShadeTiltOnly (Mid only)Fix logging regression on initial setupFixes for ShadeVerticalTiltAnywhere + ShadeTiltOnlyFix testsRemove unneeded declerationsFix shade position reporting for v2 shadesDandle empty hub data being returned
Package: aiopvpc
aiopvpcSimple aio library to download Spanish electricity hourly prices.Made to support thepvpc_hourly_pricingHomeAssistant integration.InstallInstall withpip install aiopvpcor clone it to run tests or anything else.UsageimportaiohttpfromdatetimeimportdatetimefromaiopvpcimportPVPCDataasyncwithaiohttp.ClientSession()assession:pvpc_handler=PVPCData(session=session,tariff="2.0TD")esios_data=awaitpvpc_handler.async_update_all(current_data=None,now=datetime.utcnow())print(esios_data.sensors["PVPC"])
Package: aiopyarr
aiopyarrPython API client for Lidarr/Radarr/Readarr/Sonarr.Installationpython3-mpipinstallaiopyarrExample usageMore examples can be found in thetestsdirectory."""Example usage of aiopyarr."""importasynciofromaiopyarr.models.host_configurationimportPyArrHostConfigurationfromaiopyarr.radarr_clientimportRadarrClientIP="192.168.100.3"TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"asyncdefasync_example():"""Example usage of aiopyarr."""host_configuration=PyArrHostConfiguration(ipaddress=IP,api_token=TOKEN)asyncwithRadarrClient(host_configuration=host_configuration)asclient:print(awaitclient.async_get_system_status())asyncio.get_event_loop().run_until_complete(async_example())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 themasterbranch
Package: aio_pybars
aio_pybars========Quick Start------------------0. Install::pip install aio_pybarsOR via setup.py::python setup.py install1. Configure your app::from aio_pybars import FSTemplateLoaderloop.run_until_complete(aio_pybars.setup(app,templates_dir=config['TEMPLATES_DIR'],Loader=FSTemplateLoader))2. Use templates in the view::async def index(request):context = {"var": "value"}return AIOBarsResponse(request, 'template_name', context)It will render the `template_name.hbs` template with variables in the `context` to the aiohttp response.Helpers and partials------------------------------------Partial is the nested template that should be included in the specific place.If the following code occurs in the template::{{> "sidebar"}}pybars3 will search the _partial_ named `sidebar` in the dictionary. How to add your own partial see below.Helper is the callable that can be called from the template. Syntactically it looks same as the variable, but canget the arguments::<link rel="shortcut icon" href="{{asset "favicon.ico"}}">would call the `asset` callable with "favicon.ico" argument and put the results in the rendered template.*To use your own partials and helpers* implement your subclass of templates loader::class AppFSTemplateLoader(FSTemplateLoader):def __init__(self, app, base_dir):super().__init__(app, base_dir)def get_partials(self):"""Load all files in the partials/ subdirectory of templates dir.Method should return the dictionary {'partial_name': <compiled template>, ...}"""partials = super().get_partials()base_partials = os.path.join(self.app.config['TEMPLATES_DIR'], 'partials')for name in os.listdir(base_partials):filename = os.path.splitext(name)[0]template_source = open(os.path.join(base_partials, name), 'r', encoding='utf8').read()template = self.compiler.compile(template_source)partials[filename] = templatereturn partialsdef get_helpers(self):"""Define your own set of helpers.Method should return the dictionary {'helper_name': <callable>, ...}"""helpers = super().get_helpers()helpers.update({"asset": _asset})return helpersdef _asset(options, val, *args, **kwargs):return "/static/{}".format(val)and pass it as Loader argument to the setup::loop.run_until_complete(aio_pybars.setup(app,templates_dir=config['TEMPLATES_DIR'],Loader=AppFSTemplateLoader))Recursive rendering of templates--------------------------The aio_pybars enables templates to be recursive. If the first line of the template contains::{{!< base_template}}all the rendered template will be passed as variable `body` to the base template.For example:base.hbs::<!DOCTYPE html><html><head><title>Template</title></head><body>{{body}}</body>test.hbs::{{!< base}}Hello, {{name}}.Then result of the `render(loader, 'test', {'name': 'Roma'})` will be::<!DOCTYPE html><html><head><title>Template</title></head><body>Hello, Roma</body>
Package: aio-pydispatch
aio_pydispatchAsyncio pydispatch (Signal Manager)This is based onpyDispatcherreferenceDjango Signalsand referencescrapy SignalManagerimplementation onAsyncioEvent or Signal (not python bif signal)You can bind multiple listeners (called sender) to listening multiple handlers (called receiver)
on one event (called signal).Default, the listener is None, so when the event is fire with no listener, all handlers will be
executed that was bind default listener.UsageMost of the program hasstartandstopevents, we can register some handler to events,
we can also specify a sender.importasynciofromaio_pydispatchimportSignalserver_start=Signal()server_stop=Signal()defppp(value:str,**kwargs)->None:print(value,kwargs)asyncdefmain():server_start.connect(ppp,sender='loading config')server_stop.connect(ppp)awaitserver_start.send(sender='loading config',value='foo')awaitasyncio.sleep(1)awaitserver_stop.send(value='foo')if__name__=='__main__':asyncio.run(main())Similar designsync:pyDispatcherDjango.dispatchscrapy SignalManagerblinkerasync:Aiohttp tracingOthersEvent system in Python
Package: aiopygismeteo
aiopygismeteoАсинхронная обёртка дляGismeteo API.Синхронная версияздесь.Разработка приостановленаДля использования библиотеки нужен API токен, который можно запросить по электронной почтеb2b@gismeteo.ru.В настоящее время у разработчика отсутствует API токен, что делает невозможными тестирование и дальнейшую разработку.Если вам нужна погодная библиотека без API токена, можете рассмотретьhttps://github.com/monosans/aiopywttr.Установкаpython-mpipinstall-Uaiopygismeteopygismeteo-baseДокументацияhttps://aiopygismeteo.readthedocs.ioLicense / ЛицензияMIT
Package: aiopypes
(pronounced "a-i-o-pipes")Scalable asyncio pipelines in Python, made easy.📝 Table of ContentsAboutGetting StartedUsageBuilt UsingTODOContributingAuthorsAcknowledgments🧐 AboutThis package is designed to make building asynchronous streams that balance and
scale automaticallyeasy. Built on pure Python -- no dependencies -- this
framework can be used for variable, decoupled, task-based workloads like
web scraping, database management operations, and more. Scale this out-of-the-box,
with minimal hardware and coding, to process 10k+/s on production loads.Simple pipelinesimport aiopypes

app = aiopypes.App()

@app.task(interval=1.0)
async def every_second():
    return datetime.utcnow()

@app.task()
async def task1(stream):
    async for s in stream:
        print(f"streaming from task1: {s}")
        yield obj

if __name__ == '__main__':

    pipeline = every_second \
               .map(task1)

    pipeline.run()To scaled pipelinesimport aiopypes
import aiohttp

app = aiopypes.App()

@app.task(interval=0.1)
async def every_second():
    return "http://www.google.com"

@app.task(scaler=aiopypes.scale.TanhTaskScaler()) #  this scales workers automatically to consume incoming requests
async def task1(stream):
    async for s in stream:
        yield await aiohttp.get(s)

async def task2(stream):
    async for s in stream:
        if s.response_code != 200:
            print("failed request: {s}")
        yield

if __name__ == '__main__':

    pipeline = every_second \
               .map(task1)
               .reduce(task2)

    pipeline.run()🏁 Getting StartedStart with a simple pipeline, and build out from there!import aiopypes

app = aiopypes.App()

@app.task(interval=1.0)
async def every_second():
    return datetime.utcnow()

@app.task()
async def task1(stream):
    async for s in stream:
        print(f"streaming from task1: {s}")
        yield obj

if __name__ == '__main__':

    pipeline = every_second \
               .map(task1)

    pipeline.run()For more, seereadthedocsPrerequisitesaiopypesis based on pure Python (3.5+) and does not require other dependencies.InstallingAvailable on PyPihere, installed with pip:pip install aiopypes🔧 Running the testsTo be created!Break down into end to end testsTo be created!And coding style testsTo be created!🎈 UsageImport the libraryimport aiopypesCreate an App objectapp = aiopypes.App()Create a trigger task@app.task(interval=1.0)
async def every_second():
    return 1Create downtream tasks@app.task()
async def task_n(stream):
    async for s in stream:
        # process "s" here
        yieldCreate + configure the pipelinepipeline = every_second \
            .map(task_n)Run the pipelinepipeline.run()This will run continuously until interrupted.⛏️ Built UsingPythonasyncio✔️ TODOExtend to multithreadsExtend to multiprocessBuild visualization serverAdd pipeline pipe functions (join, head, ...)✍️ Authors@mroumanosContributors: you?🎉 Acknowledgementsfaust streaming