Saravanan666/pypi-org huggingface dataset:
Package: aino-utkik
aino-utkik provides minimalistic class based views for Django focusing on
common usage, readability and convienience.For Django 1.3 or earlier use 0.7.8
For Django 1.7 or later use 0.8.0 or laterExample:# urls.py
from utkik.dispatch import *

urlpatterns = patterns('',
    (r'^(?P<slug>[-\w]+)/$', 'news.NewsDetailView'),
    (r'^$', 'news.NewsListView'),
)

# news/views.py
from django.shortcuts import get_object_or_404
from news.models import News
from utkik import View

class NewsDetailView(View):
    template_name = 'news/news_detail.html'

    def get(self, slug):
        self.c.news = get_object_or_404(News.objects, slug=slug)


class NewsListView(View):
    template_name = 'news/news_list.html'

    def get(self):
        self.c.news_list = News.objects.all()
Package: ain-py
ain-pyA python version ofain-js.Installationpip install ain-pyRun all testtoxExamplesfromain.ainimportAinimportasyncioain=Ain('https://mainnet-api.ainetwork.ai/')asyncdefprocess():accounts=awaitain.db.ref('/accounts').getValue()print(accounts)loop=asyncio.get_event_loop()loop.run_until_complete(process())
Package: ainyan
Provdes two scripts:ainyan-trainingainyan-datasetDATASET PREPAREainyan-datasets--sourcejgate-lite--dspaths3://wadalabs/jgate-test--profilejpxTRAININGTRAINING=jgate.iniainyan-trainingWith jgate.ini like:[training]model=NousResearch/Llama-2-7b-chat-hfaws_profile=jpxdataset=s3://wadalabs/jgate-smallfinalname=jgate-smalllearning_rate=2e-3max_steps=100MODEL S3 HELPER# Uploadainyan-model-helper--profilejpx--modeup--modeljgate-full--bucketwadalabs# Downloadainyan-model-helper--profilejpx--modedl--modeljgate-full--bucketwadalabs
Package: aio2ch
Fully asynchronous read-only API wrapper for 2ch.hk (dvach, Двач)RequirementshttpxaiofilesclickInstall with pip$pip3installaio2chBuild from source$gitclonehttps://github.com/wkpn/aio2ch$cd./aio2ch$python3setup.pyinstallUsageSimple usage (in this caseclient.close()must be called when client is no longer needed)>>>fromaio2chimportApi>>>client=Api()>>>...>>>awaitclient.close()Or you can use it as a context manager>>>asyncwithApi()asclient:...boards=awaitclient.get_boards()......Get all boards>>>boards=awaitclient.get_boards()>>>boards(<Boardname='Фагготрия',id='fag'>,...)In addition we can getstatusfor each method. This is useful for debug purposes or if retries are needed>>>status,boards=awaitclient.get_boards(return_status=True)>>>status200>>>boards(<Boardname='Фагготрия',id='fag'>,...)Get all threads from a board>>>threads=awaitclient.get_board_threads(board="b")>>>threads(<Threadnum='180981319'>,...)Get top threads from a board sorted by method (views,scoreorposts_count)>>>top_threads=awaitclient.get_top_board_threads(board="b",method="views",num=3)>>>top_threads(<Threadnum='180894312'>,<Threadnum='180946622'>,<Threadnum='180963318'>)Get all thread’s posts (threadis an instance ofThread)>>>thread_posts=awaitclient.get_thread_posts(thread=thread)>>>thread_posts(<Postnum='180894312'>,...)Get all thread’s posts  by url>>>thread_posts=awaitclient.get_thread_posts(thread="https://2ch.hk/test/res/30972.html")>>>thread_posts(<Postnum='30972'>,...)Get all media in all thread’s posts (images, webm and so on)>>>thread_media=awaitclient.get_thread_media(thread=thread)>>>thread_media(<Filename='15336559148500.jpg',path='/b/src/180979032/15336559148500.jpg',size='19'>,...)Get specific thread media>>>images_and_videos=awaitclient.get_thread_media(thread,media_type=(Image,Video))>>>images_and_videos(<Imagename=...>,<Videoname=...>,...)>>>just_images=awaitclient.get_thread_media(thread,media_type=Image)>>>just_images(<Imagename=...>,...)Download all thread media>>>awaitclient.download_thread_media(files=thread_media,save_to="./downloads")
Package: aio4chan
Contents4chan API reader.Installingpython3 -m pip install aio4chanUsageimportasyncioimportaiohttpimportaio4chanloop=asyncio.get_event_loop()session=aiohttp.ClientSession(loop=loop)client=aio4chan.Client(session=session,loop=loop)asyncdefexecute():"""Traverse 4chan."""boards=awaitclient.get_boards()# short namesboard_ids=(board.boardforboardinboards)forboard_idinboard_ids:pages=awaitclient.get_threads(board_id)# list of pages, each containing threadsthread_ids=(thread.noforpageinpagesforthreadinpage.threads)forthread_idinthread_ids:# need both board_id and thread_idthread=awaitclient.get_thread(board_id,thread_id)forpostinthread:try:# might not existcomment=post.comexceptAttributeError:continue# print where we got it, and the commentprint(board_id,'>',thread_id,'>',post.no,'\n',post.com)try:loop.run_until_complete(execute())exceptKeyboardInterrupt:passfinally:loop.run_until_complete(session.close())loop.close()
Package: aio9p
aio9pAsyncio-based bindings for the 9P protocol. Work in progress.Working examples for the 9P2000 and 9P2000.u dialects are implemented in
aio9p.example .Features9P2000 client and server9P2000.u client and serverTransports: TCP, domain socketsTODODocumentationClient examples.FeaturesSupport for the 9P2000.L dialectTestingSignificantly expanded unit testingExpanded integration testsBenchmarking
Package: aioabcpapi
AioAbcpApiАсинхронная библиотека дляAPI ABCPсasyncioиaiohttpПрисоединяйтесь ктелеграм чатуУстановкаpip install aioabcpapiОписаниеВсе методы максимально приближены к древовидному оформлениюофициальной документации.Разделяются наcpиts, они в свою очередь разделяются наclientиadmin, далее для поиска нужного вам метода
отталкивайтесь от документацииAPI ABCP.Для примера, из документацииTS.Client,Обновление позиции в корзинеописание операции следующее:Операция: POST /ts/cart/updateДля использования этого метода нам нужно будет обратиться кawait api.ts.client.cart.update()Доступ к APIДля API АдминистратораЕсли вы являетесь клиентом магазина на платформе ABCP, обратитесь к вашему менеджеру. (Вам понадобится статический IP адрес)ПримечаниеВсе аргументы времени, такие какcreate_time,update_time,date_start,date_endи прочие, принимаютstrилиdatetime. При передачеdatetimeобъект будет преобразован в зависимости от требований метода вRFC3339или"%Y-%m-%d %H:%M:%S"ПримерimportasynciofromaioabcpapiimportAbcphost,login,password='id33333','api@id33333','md5hash'api=Abcp(host,login,password)asyncdefsearch_some_parts(article,brand):search_result=awaitapi.cp.client.search.articles(number=article,brand=brand,use_online_stocks=True,disable_online_filtering=True,with_out_analogs=True)forxinsearch_result:iffloat(x['price'])<3000:print('Похоже на чудо, но скорее ошибка прайса. Отключим пока поставщика')awaitapi.cp.admin.distributors.edit_status(x['distributorId'],False)eliffloat(x['price'])<37000:awaitapi.cp.client.basket.add(basket_positions={'number':x['article'],'brand':x['brand'],'supplierCode':x['supplierCode'],'itemKey':x['itemKey'],'quantity':1,'comment':f"Да, РРЦ никто не любит"})if__name__=='__main__':asyncio.run(search_some_parts('602000600','LuK'))Больше примеров
Package: aioaccount
aioaccountUtility for user account creation, modification & email confirmation.Installationpip3 install aioaccountDocsaioaccount.readthedocs.ioFeaturesSecurity.Easy to use.Removes common boilerplate code.SMTP support.Email template support with jinja2.Mongodb, postgresql, mysql & sqlite support.Full unit tests.Full documentation.Uses aiojobs to spawn SMTP background jobs.SecurityAll passwords are hashed using bcrypt.Password policies.Password reset code expiration.Email validation.Thanks tobcryptpassword-strengthdatabasessqlalchemymotoremail-validatoraiosmtplibaiojobsjinja2asynctestsphinxsphinx materialEveryone who helped to make these packages
Package: aioactioncable
aioactioncable: async Action Cable client libraryaioactioncable is a python library for building Ruby on RailsAction Cableclients.The library is based onwebsocketsand asyncio.aioactioncable is thus an async Rails Action Cable client library.Installation$ python3 -m pip install aioactioncableaioactioncable requires Python 3 and therefore needs to be installed using the Python 3 version of pip.RequirementsPython >= 3.7websocketsUsageIn addition to managing websockets connections, Action Cable servers manage multiple channels, that clients can subscribe to.Here is a code example to connect to an Action Cable server, subscribe to a channel and receive messages on that channel:#!/usr/bin/env python3importaioactioncableimportasyncioimportjsondefprocess(msg,identifier)msg_json=json.loads(msg)print(f'Message received on{json.dumps(identifier)}')...asyncdefac_recv(uri,identifier):asyncwithaioactioncable.connect(uri)asacconnect:subscription=awaitacconnect.subscribe(identifier)asyncformsginsubscription:process(msg,identifier)asyncio.run(ac_recv('wss://example.app',{'channel':'ChatChannel'}))All the code examples below must be run in an asyncio event loop.Examples are built "chronologically", object created in Connect section is reused in Subscribe section, and so on.Connect to an Action Cable serverimportaioactioncableacconnect=aioactioncable.connect(uri)aioactioncable Connect object is an async context manager, you can thus use it in anasync withstatement:importaioactioncableimportasyncioasyncwithaioactioncable.connect('wss://example.app')asacconnect:...Subscribe to an Action Cable channelsubscription=awaitacconnect.subscribe({'channel':'ChatChannel'})Recv messages on an Action Cable channelReceive next message on subscription channel:msg=awaitsubscription.recv()Subscription object is an iterable, you can thus iterate over to recv messages in an async for loop:asyncformsginsubscription:...Send messages on an Action Cable channelawaitsubscription.send({'action':'create','chatRoom':'climbing'})Unsubscribe from an Action Cable channelawaitsubscription.unsubscribe()Close an Action Cable server connectionExplicit close of the connection is not needed if it is done in anasync withstatement.Otherwise:awaitacconnect.close()Licenseaioactioncable is distributed under the MIT license.ContributionsContributions are very welcome!Feel free to open anissuefor any bug report.Feel free to propose bug fixes or features via aPull Request.
Package: aio-adb-shell
Documentation for this package can be found athttps://aio-adb-shell.readthedocs.io/.This Python package implements ADB shell and FileSync functionality.  It originated frompython-adb.Installationpip install aio-adb-shellExample Usage(Based onandroidtv/adb_manager.py)fromaio_adb_shell.adb_deviceimportAdbDeviceTcpfromaio_adb_shell.auth.sign_pythonrsaimportPythonRSASigner# Connect (no authentication necessary)device1=AdbDeviceTcp('192.168.0.111',5555,default_timeout_s=9.)awaitdevice1.connect(auth_timeout_s=0.1)# Connect (authentication required)withopen('path/to/adbkey')asf:priv=f.read()signer=PythonRSASigner('',priv)device2=AdbDeviceTcp('192.168.0.222',5555,default_timeout_s=9.)awaitdevice2.connect(rsa_keys=[signer],auth_timeout_s=0.1)# Send a shell commandresponse1=awaitdevice1.shell('echo TEST1')response2=awaitdevice2.shell('echo TEST2')
Package: aioaerospike
aioaerospikeThis library is planned to be an async API for Aerospike.
The library will be Pure-Python, Protocol based on the C Client.InstallationUsing pip$ pip install aioaerospikeContributingTo work on theaioaerospikecodebase, you'll want to fork the project and clone it locally and install the required dependencies viapoetry:$gitclonegit@github.com:{USER}/aioaerospike.git
$makeinstallTo run tests and linters use command below (Requires aerospike to run locally on port 3000):$makelint&&maketestIf you want to run only tests or linters you can explicitly specify which test environment you want to run, e.g.:$makelint-blackLicenseaioaerospikeis licensed under the MIT license. See the license file for details.Latest changes0.1.6 (XXXX-XX-XX)0.1.5 (2019-12-17)Added TTL argument for put_keyAdded operate method, enables users to interact with lower-level API to do specific actions, such as multi op
(read, write, modify, etc) in same message.Added UNDEF/AerospikeNone for the option of empty bins, when reading specific bins.0.1.4 (2019-12-07)Added delete key methodAdded key_exists methodChanged signature of put_key to be a dict, for easy multiple bins insert.0.1.3 (2019-12-07)Changed all enums to uppercaseAdded tests for all supported key typesAdded support for dict and list as values.0.1.2 (2019-12-07)Fixed key digest, key type can be all supported types (int, float, str, bytes)0.1.1 (2019-12-07)Fixed license and metadataThis package is 3rd party, unrelated to Aerospike company
Package: aio-aerospike-python
asyncio wrapper of aerospike python client libraryThis project is work in progress. please do not use it in production yet.This project provides a simple way to use aerospike with asyncio.This project is based onAerospike python client library docsDocsinstallationpipinstallaio-aerospike-pythonQuick startstart docker composedockercomposeup-dfromaio_aerospike_pythonimportAioAerospikeClientimportasyncioconfig={'hosts':[('0.0.0.0',3000)]}client=AioAerospikeClient(config)print(client.is_connected())asyncdefput_some_data(limit:int):foriinrange(limit):key=("test","test",i)data={"a":i}awaitclient.put(key,data)asyncdefread_data(limit:int):foriinrange(limit):key=("test","test",i)r=awaitclient.get(key)print(r)loop=asyncio.get_event_loop()loop.run_until_complete(put_some_data(33))loop.run_until_complete(read_data(33))client.close()Now lets test it with concurrencyfromaio_aerospike_pythonimportAioAerospikeClientfromaio_aerospike_pythonimportexceptionfromaerospike_helpersimportexpressionsasexpimportaerospikeimportasyncioconfig={'hosts':[('0.0.0.0',3000)]}client=AioAerospikeClient(config)print(client.is_connected())asyncdefput_some_data(limit:int):foriinrange(limit):key=("test","test",i)data={"a":i}awaitclient.put(key,data)asyncdefread_data(limit:int):keys=[("test","test",i)foriinrange(limit)]# print(keys)r=awaitclient.get_many(keys)print(r)asyncdefuse_query(mina:int,maxa:int):query=client.query("test","test")expr=expr=exp.And(exp.LT(exp.IntBin("a"),maxa),exp.GT(exp.IntBin("a"),mina)).compile()scan_policy={"expressions":expr}results=awaitquery.results(scan_policy)print("query results ===")forrinresults:print(r)asyncdefuse_scan(mina:int,maxa:int):scan=client.query("test","test")expr=exp.And(exp.LT(exp.IntBin("a"),maxa),exp.GT(exp.IntBin("a"),mina)).compile()scan_policy={"expressions":expr}results=awaitscan.results(scan_policy)print("scan results ===")forrinresults:print(r)asyncdeftest_append(key=("test","test",3),bin="a",val="test",meta=None,policy=None):awaitclient.put(key=key,bins={"vv":"test_"})awaitclient.append(key=key,bin="vv",val="append",meta=meta,policy=policy)r=awaitclient.get(key=key)key,_,bin=rprint("append")print(r)asyncdefmain():L=awaitasyncio.gather(put_some_data(700),read_data(50),use_query(10,20),use_scan(40,45),test_append())asyncio.run(main())LicenseThe AIO Aerospike Python Client is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.
Package: aioairq
PyPI packageaioairqPython library for asynchronous data access to local air-Q devices.Retrieve data from air-QAt its present state,AirQrequires anaiohttpsession to be provided by the user:importasyncioimportaiohttpfromaioairqimportAirQADDRESS="123ab_air-q.local"PASSWORD="airqsetup"asyncdefmain():asyncwithaiohttp.ClientSession()assession:airq=AirQ(ADDRESS,PASSWORD,session)config=awaitairq.configprint(f"Available sensors:{config['sensors']}")data=awaitairq.dataprint(f"Momentary data:{data}")asyncio.run(main())
Package: aioairtable
Key FeaturesAsyncio andaiohttpbasedAllairtable REST APImethods supportedAPI rate limit supportFully type annotated (PEP 484)Installationaioairtable is available on PyPI. Use pip to install it:pipinstallaioairtableRequirementsPython >= 3.8aiohttpmultidictbackoffaiofreqlimityarlUsing aioairtablePass a value of any hashable type toacquireor do not specify any parameter:importasynciofromaioairtableimportAirtable,SortDirectionasyncdefmain():airtable=Airtable(api_key='some_key')base=airtable.base('base_id')table=base.table('table_name')records,offset=awaittable.list_records(fields=('field_1','field_2'),filter_by_formula='{field_3}',max_records=100500,page_size=3,sort=(('field_1',SortDirection.ASC),('field_2',SortDirection.DESC)),view='table3',offset='record033')forrecordinrecords:print(record)record=awaittable.create_record({'field_1':'value_1_new_001','field_2':'value_2_new_001','field_3':'value_3_new_001'})awaitrecord.delete()asyncio.run(main())
Package: aioairzone
aioairzonePython library to control Airzone devices.RequirementsPython >= 3.11InstallpipinstallaioairzoneInstall from SourceRun the following command inside this folderpipinstall--upgrade.ExamplesExamples can be found in theexamplesfolderAPI Call examplesRun the following command to list all your Airzone Zones:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/hvac" -d '{"systemID": 0, "zoneID": 0}' | jqRun the following command to list all your Airzone Systems:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/hvac" -d '{"systemID": 127}' | jqRun the following command to fetch your Airzone Altherma parameters:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/hvac" -d '{"systemID": 0}' | jqRun the following command to fetch your Airzone WebServer parameters:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/webserver" | jqRun the following command to fetch a demo Airzone Zone:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/demo" | jqRun the following command to fetch your Airzone LocalAPI version:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/version" | jqRun the following command to fetch your Airzone LocalAPI integration driver:curl -s --location --request POST "http://192.168.1.25:3000/api/v1/integration" -d '{}' | jq
Package: aio-alf
aio-alf |build-status|===========aiohttp OAuth 2 Client---------------------`aio-alf` is a OAuth 2 Client base on the aiohttp's AsyncHTTPClientFeatures--------* Automatic token retrieving and renewing* Token expiration control* Automatic retry on status 401 (UNAUTHORIZED)Usage-----Initialize the client and use it as a AsyncHTTPClient object... code-block:: pythonfrom aioalf.client import Clientfrom aioalf.httpclient import HTTPRequestclient = Client(token_endpoint='http://example.com/token',client_id='client-id',client_secret='secret')resource_uri = 'http://example.com/resource'response = await client.request('POST',resource_uri,data='{"name": "alf"}',headers={'Content-Type': 'application/json'})Alternatively one can pass directly a string to the fetch client.. code-block:: python# ...response = await client.request('POST','http://example.com/resource',data='{"name": "alf"}',headers={'Content-Type': 'application/json'})Implicit Flow-------------Support for OAuth2 implict flow to enable it, call `use_implicit_flow` with a `TokenStorage`object and a port range, it defaults to the range (32000, 32009).Example:.. code-block:: pythonawait use_implicit_flow(TokenStorage(), (30000, 30009))async with Client(token_endpoint='https://token.endpoint',client_id='glBQ3nYU/8/kaVi/bIgXGA==',client_secret='') as client:response = await client.request('GET', 'http://example.com/resource')text = await response.text()print(response.status)The library has a really simple in memory token storage, you should subclass and overwriteits methods if you need to persist the token for a longer period.How it works?-------------Before any request the client tries to retrieve a token on the endpoint,expecting a JSON response with the ``access_token`` and ``expires_in`` keys.The client keeps the token until it is expired, according to the ``expires_in``value.After getting the token, the request is issued with a `Bearer authorizationheader <http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-7.1>`_:.. code-block::GET /resource/1 HTTP/1.1Host: example.comAuthorization: Bearer tokenIf the request fails with a 401 (UNAUTHORIZED) status, a new token is retrievedfrom the endpoint and the request is retried. This happens only once, if itfails again the error response is returned.Troubleshooting---------------In case of an error retrieving a token, the error response will be returned,the real request won't happen.Related projects----------------This project tries to be an adaptation to aiohttp of`alf <https://github.com/globocom/alf>`_.. |build-status| image:: https://secure.travis-ci.org/globocom/aio-alf.png?branch=master:target: https://travis-ci.org/globocom/aio-alf
Package: aioalfacrm
AIOAlfacrmaioalfacrm- is an asynchronous implementation for theAlfaCRM APIPackage is in developmentInstallation using pip$ pip install aioalfacrmExample:importasynciofromaioalfacrmimportAlfaClientfromaioalfacrm.entitiesimportLocationHOSTNAME='demo.s20.online'EMAIL='api-email@email.example'API_KEY='user-api-token'BRANCH_ID=1asyncdefmain():alfa_client=AlfaClient(hostname=HOSTNAME,email=EMAIL,api_key=API_KEY,branch_id=BRANCH_ID,)try:# Check auth (Optionaly)ifnotawaitalfa_client.check_auth():print('Authentification error')return# Get branchesbranches=awaitalfa_client.branch.list(page=0,count=20)# Edit branchforbranchinbranches:branch.name=f'{branch.name}- Edited'# Save branchawaitalfa_client.branch.save(branch)# Create locationlocation=Location(branch_id=1,is_active=True,name='New location',)awaitalfa_client.location.save(location)finally:# Close sessionawaitalfa_client.close()asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())# For Windowsasyncio.run(main())Paginator# Get all entitiesforpageinalfa_client.<object>.get_paginator():objects=page.itemsCustom fieldsTo work with custom fields, do the followingfromaioalfacrmimportentitiesfromaioalfacrmimportfieldsfromtypingimportOptional# Extend existing modelclassCustomCustomer(entities.Customer):custom_field:Optional[int]=fields.Integer()# For IDE init supportdef__init__(self,custom_field:Optional[int]=None,*args,**kwargs,):super(CustomCustomer,self).__init__(custom_field=custom_field,*args,**kwargs)# Create custom alfa client with new modelfromaioalfacrmimportAlfaClientfromaioalfacrmimportmanagersclassCustomAlfaClient(AlfaClient):def__init__(self,*args,**kwargs):super(CustomAlfaClient,self).__init__(*args,**kwargs)self.customer=managers.Customer(api_client=self.api_client,entity_class=CustomCustomer,)# Create custom alfa clientimportasyncioHOSTNAME='demo.s20.online'EMAIL='api-email@email.example'API_KEY='user-api-token'BRANCH_ID=1asyncdefmain():alfa_client=CustomAlfaClient(hostname=HOSTNAME,email=EMAIL,api_key=API_KEY,branch_id=BRANCH_ID)try:customers=awaitalfa_client.customer.list()forcustomerincustomers:print(customer.custom_field)finally:awaitalfa_client.close()asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())# For Windowsasyncio.run(main())