Saravanan666/pypi-org huggingface dataset:
Package: aiosolr
aiosolrAsyncIO Python client for Apache SolrRequirementsThis project requires Python 3.6+InstallationTo install with pippip install aiosolrUsageThe connection to the Solr backend is defined during object initialization. The accepted kwargs
to init arescheme,host,port,collection, andtimeout.Note: collection may also be passed at query timeimport aiosolr

client = aiosolr.Client(host=localhost, collection="example", port=8983)Alternatively you may instantiate via passing a connection URL like:import aiosolr

client = aiosolr.Client(connection_url="http://host:1234/path/to/solr/collection")Once you have yourSolrinstance, you need to setup the session like:client.setup()Then there are methods available for querying.
You can use Solr's built-in get handler with thegetmethod like:client.get(document_id)to retrieve a single document.You can use a pre-defined suggestions handler by using thesuggestionsmethod like:client.suggestions("suggest_handler", query="asdf")You can also use the suggestions method to build your suggestions like:client.suggestions("suggest_handler", build=True)Note: handler is a required argument for suggestions unlike for get or queryYou can use thequerymethod to query your search handler. The default handler used is "select".
If you would like spellcheck suggestion turned on, passspellcheck=True(default is False).client.query(handler="my_handler", query="asdf", spellcheck=True)IfspellcheckisTruethe query method returns a tuple with the first element being
an array of documents and the 2nd element being an array of spellcheck suggestions.
Otherwise, the query method returns a simple array of documents.You can use theupdatemethod to access Solr's built-in update handler like:client.update(my_data)At any point that you need to commit data to your collection you can use thecommitmethod.
Arguments should be the "handler" ("update" by default) and "soft" as a boolean indicating
whether it should be a hard or soft commit (defaults to False).There is one more method you might want to use before querying Solr especially
if the query is coming from an untrusted end user. There is aclean_querymethod which can be
used to strip out unwanted characters. The function signature allows the following arguments:@staticmethod
def clean(
    query,  # end user query
    allow_html_tags=False,
    allow_http=False,
    allow_wildcard=False,
    escape_chars=(":", r"\:"),  # tuple of (replace_me, replace_with)
    max_len=200,
    # regex of chars to remove
    remove_chars=r'[\&\|\!\(\)\{\}\[\]\^"~\?\\;]',
    urlencode=True,
):Use it like:trusted_query = aiosolr.clean_query(users_query)Once you are finished with the Solr instance, you should call the methodcloseto cleanup
sessions like:await client.close()DebuggingTo get more information from the Client you can initialize withdebug=Truelike:import aiosolr

client = aiosolr.Client(host=localhost, collection="example", port=8983, debug=True)This sets theaiosolrlogger to debug level, and also sets the internally used HTTP session
(provied byAIOHTTP) to a debug level.This makes it easier to see the actual network request going to Solr.
Package: aiosoma
Asynchronous SOMA Connect libraryAsyncio library that controls SOMA Shades via a SOMA Connect device.InstallationInstall this via pip (or your favourite package manager):pip install aiosomaReviewthe documentationfor usage.Contributors ✨Thanks goes to these wonderful people (emoji key):Avi Miller💻📖🚧⚠️This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template.
Package: aiosonic
aiosonic - lightweight Python asyncio http clientVery fast, lightweight Python asyncio http clientHere is somedocumentation.There is a performance script in tests folder which shows very nice numbers» python tests/performance.py
doing tests...
{
 "aiosonic": "1000 requests in 182.03 ms",
 "aiosonic cyclic": "1000 requests in 370.55 ms",
 "aiohttp": "1000 requests in 367.66 ms",
 "requests": "1000 requests in 4613.77 ms",
 "httpx": "1000 requests in 812.41 ms"
}
aiosonic is 101.97% faster than aiohttp
aiosonic is 2434.55% faster than requests
aiosonic is 103.56% faster than aiosonic cyclic
aiosonic is 346.29% faster than httpxThis is avery basic, dummy test, machine dependant. If you look for performance, test and compare your code with this and other packages like aiohttp.You can perform this test by installing all test dependencies withpip install -e ".[test]"and doingpython tests/performance.pyin your own machineRequirements:Python>=3.7PyPy>=3.7Features:Keepalive and smart pool of connectionsMultipart File UploadsChunked responses handlingChunked requestsConnection TimeoutsAutomatic DecompressionFollow RedirectsFully type annotated.100% test coverage (Sometimes not).HTTP2 (BETA) when using the correct flagInstallationpip install aiosonicUsageimportasyncioimportaiosonicimportjsonasyncdefrun():client=aiosonic.HTTPClient()# ################### Sample get request# ##################response=awaitclient.get('https://www.google.com/')assertresponse.status_code==200assert'Google'in(awaitresponse.text())# ################### Post data as multipart form# ##################url="https://postman-echo.com/post"posted_data={'foo':'bar'}response=awaitclient.post(url,data=posted_data)assertresponse.status_code==200data=json.loads(awaitresponse.content())assertdata['form']==posted_data# ################### Posted as json# ##################response=awaitclient.post(url,json=posted_data)assertresponse.status_code==200data=json.loads(awaitresponse.content())assertdata['json']==posted_data# ################### Sample request + timeout# ##################fromaiosonic.timeoutimportTimeoutstimeouts=Timeouts(sock_read=10,sock_connect=3)response=awaitclient.get('https://www.google.com/',timeouts=timeouts)assertresponse.status_code==200assert'Google'in(awaitresponse.text())awaitclient.shutdown()print('success')if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(run())TODO'SHTTP2GetRequest with data sendingDo a aiosonic release with stable http2Better documentationInternational Domains and URLs (idna + cache)Basic/Digest AuthenticationRequests using a http proxySessions with Cookie PersistenceElegant Key/Value CookiesDevelopmentInstall packages with pip-tools:pipinstallpip-tools
pip-compile
pip-compiletest-requirements.in
pip-syncrequirements.txttest-requirements.txtContributeForkcreate a branchfeature/your_featurecommit - push - pull requestThanks :)Contributors
Package: aiosow
AsynchronousI/OSoftwareOrchestrationWorkstationaiosowis functionnal framework on top of an asynchronous task manager.It is meant to allow software architect shape how code should be used.Enforced Separation of Concernsaiosowencourage a structure that separate implementations from the behavior.Defined boundaries for different parts of the codebase makes it easier to reason from buisness perspective.No framework friction & Unparalled modularityImplementation have no knoweledge ofaiosow.Splittingimplementationfrom their usage allows one to completely rewrite how it's different
elements are used, swap them, combine them.Exampleimplementation.pydefinitialize_memory():return{"message":"hello world !"}defprint_message(message):print(message)bindings.pysetup(initialize_memory)routine(1)(print_message)LicenseThis project is licensed under theMIT License
Package: aiosox
aiosox:repo linkQuick examplecan be installed using pip/poetry:poetry shell
 
poetry run uvicorn example:app --port=8001fromtypingimportListfromfastapiimportFastAPIfrompydanticimportBaseModelfromaiosoximportSioAuth,SioNamespace,SocketIoServerdefget_app():applitcation=FastAPI(title="tester")returnapplitcationapp=get_app()sio_server:SocketIoServer=SocketIoServer(app=app,kafka_url="localhost:29092")user_namespapce:SioNamespace=SioNamespace("/user",socket_io_server=sio_server)sio_server._sio.register_namespace(user_namespapce)@app.on_event("startup")asyncdefon_start():awaitsio_server.start()@app.on_event("shutdown")asyncdefon_shutdown():awaitsio_server.shutdown()classUserY(BaseModel):name:strclassUserT(BaseModel):name:strwhat:List[UserY]classOfferT(BaseModel):title:stron_failed_emmiter=user_namespapce.create_emitter("failed",model=OfferT|UserT)@user_namespapce.on("submit",description="when user submits a form",payload_model=UserT|UserY,response_model=List[UserT],auth=SioAuth.jwt,)asyncdefon_submit(sid,data):print(sid,data,)
Package: aio-space-track-api
AsyncSpaceTrackApi async clientSmall async wrapper for “space-track-api” package.RequirementsPython >= 3.5.0space-track-api > 1.0.0aiohttp >= 2.0.7Installingpip install aio-space-track-apiGetting startedTo retrieve something from Space-Track:# -*- coding: utf-8 -*-importasynciofrompprintimportpprintfromaio_space_track_apiimportAsyncSpaceTrackApiasyncdefmain(loop):asyncwithAsyncSpaceTrackApi(loop=loop,login='<YOUR_LOGIN>',password='<YOUR_PASSWORD>')asapi:tle_list=awaitapi.tle(EPOCH='>now-3',NORAD_CAT_ID=(25544,25541,),order_by=('EPOCH desc','NORAD_CAT_ID',),predicate=('EPOCH','NORAD_CAT_ID','TLE_LINE0','TLE_LINE1','TLE_LINE2',))pprint(tle_list,indent=2)if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(main(loop))Create simple proxy Space-Track server:# -*- coding: utf-8 -*-fromaiohttpimportwebfromaio_space_track_apiimportAsyncSpaceTrackApiasyncdefquery(request):params={mvk:request.query.getall(mvk)formvkinrequest.query.keys()}result=awaitapp['space_track'].query(**params)ifisinstance(result,(dict,list)):returnweb.json_response(result)elifisinstance(result,str):returnweb.Response(text=result)returnweb.Response(body=result)asyncdefstart_space_track(app):app['space_track']=AsyncSpaceTrackApi(loop=app.loop,login='<YOUR_LOGIN>',password='<YOUR_PASSWORD>')awaitapp['space_track'].login()asyncdefcleanup_space_track(app):awaitapp['space_track'].logout()app['space_track'].session.close()if__name__=='__main__':app=web.Application()app.on_startup.append(start_space_track)app.on_cleanup.append(cleanup_space_track)app.router.add_get('/',query)web.run_app(app,port=8080)Retrieve with “httpie” <https://github.com/jakubroztocil/httpie> package:$ http 'http://localhost:8080/?EPOCH=>now-2&NORAD_CAT_ID=25544&order_by=EPOCH%20desc&order_by=NORAD_CAT_ID&predicate=NORAD_CAT_ID&predicate=EPOCH&NORAD_CAT_ID=25541&predicate=TLE_LINE0&predicate=TLE_LINE1&predicate=TLE_LINE2'

HTTP/1.1 200 OK
Content-Length: 787
Content-Type: application/json; charset=utf-8
Date: Fri, 19 May 2017 15:36:30 GMT
Server: Python/3.6 aiohttp/2.0.7

[
    {
        "EPOCH": "2017-05-18 12:54:34",
        "NORAD_CAT_ID": "25544",
        "TLE_LINE0": "0 ISS (ZARYA)",
        "TLE_LINE1": "1 25544U 98067A   17138.53789694 +.00010471 +00000-0 +16649-3 0  9993",
        "TLE_LINE2": "2 25544 051.6431 186.1005 0005417 167.7458 303.2068 15.53904648057142"
    },
    {
        "EPOCH": "2017-05-18 01:38:13",
        "NORAD_CAT_ID": "25541",
        "TLE_LINE0": "0 ARIANE 44LP DEB",
        "TLE_LINE1": "1 25541U 88109H   17138.06821101 +.00000205 +00000-0 +11912-2 0  9995",
        "TLE_LINE2": "2 25541 006.9551 084.3526 7116887 037.1179 355.1935 02.36325430158541"
    },
    {
        "EPOCH": "2017-05-17 18:20:34",
        "NORAD_CAT_ID": "25544",
        "TLE_LINE0": "0 ISS (ZARYA)",
        "TLE_LINE1": "1 25544U 98067A   17137.76428422 +.00000891 +00000-0 +20809-4 0  9995",
        "TLE_LINE2": "2 25544 051.6403 189.9518 0005214 167.7282 292.6823 15.54019900057027"
    }
]Source codeThe latest developer version is available in a github repository:https://github.com/nkoshell/aio-space-track-api
Package: aiospamc
aiospamcis a client for SpamAssassin that you can use as a library or command line tool.The implementation is based on asyncio; so you can use it in your applications for asynchronous calls.The command line interface provides user-friendly access to SpamAssassin server commands and provides both JSON
and user-consumable outputs.DocumentationDetailed documentation can be found at:https://aiospamc.readthedocs.io/RequirementsPython 3.8 or highercertififor updated certificate authoritieslogurufor structured loggingtyperfor the command line interfaceExamplesCommand-Line Toolaiospamcis your interface to SpamAssassin through CLI. To submit a message
for a score, use:#Taketheoutputofgtube.msgandhaveSpamAssasinreturnascore$cat./gtube.msg|aiospamccheck1000.0/5.0#Pingtheserver$aiospamcpingPONGLibraryimportasyncioimportaiospamcGTUBE="""Subject: Test spam mail (GTUBE)
Message-ID: <GTUBE1.1010101@example.net>
Date: Wed, 23 Jul 2003 23:30:00 +0200
From: Sender <sender@example.net>
To: Recipient <recipient@example.net>
Precedence: junk
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This is the GTUBE, the
    Generic
    Test for
    Unsolicited
    Bulk
    Email

If your spam filter supports it, the GTUBE provides a test by which you
can verify that the filter is installed correctly and is detecting incoming
spam. You can send yourself a test mail containing the following string of
characters (in upper case and with no white spaces and line breaks):

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

You should send this test mail from an account outside of your network.
""".encode("ascii")# Ping the SpamAssassin serverasyncdefis_alive():pong=awaitaiospamc.ping()returnTrueifpong.status_code==0elseFalseasyncio.run(is_alive())# True# Get the spam score of a messageasyncdefget_score(message):response=awaitaiospamc.check(message)returnresponse.headers.spam.score,response.headers.spam.thresholdasyncio.run(get_score(GTUBE))# (1000.0, 5.0)# List the modified headersasyncdeflist_headers(message):response=awaitaiospamc.headers(message)forlineinresponse.body.splitlines():print(line.decode())asyncio.run(list_headers(GTUBE))# Received: from localhost by DESKTOP.#         with SpamAssassin (version 4.0.0);#         Wed, 30 Aug 2023 20:11:34 -0400# From: Sender <sender@example.net># To: Recipient <recipient@example.net># Subject: Test spam mail (GTUBE)# Date: Wed, 23 Jul 2003 23:30:00 +0200# Message-Id: <GTUBE1.1010101@example.net># X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on DESKTOP.# X-Spam-Flag: YES# X-Spam-Level: **************************************************# X-Spam-Status: Yes, score=1000.0 required=5.0 tests=GTUBE,NO_RECEIVED,#         NO_RELAYS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no#         version=4.0.0# MIME-Version: 1.0# Content-Type: multipart/mixed; boundary="----------=_64EFDAB6.3640FAEF"
Package: aio-spamwatch
aio-spamwatchAn asynchronous Python wrapper for theSpamWatch API.Installationpipinstallaio-spamwatchUsageimportasynciofromaio_spamwatchimportSpamwatchAPIclient=SpamwatchAPI(token="TOKEN_HERE")asyncdefmain():# import aiohttp# client = SpamwatchAPI(token="TOKEN_HERE", session=aiohttp.ClientSession())version=awaitclient.version()print(version)asyncio.run(main())
Package: aiosparql
An asynchronous SPARQL library using aiohttpSynopsisfrom aiosparql.syntax import (
    IRI, Namespace, Node, PrefixedName, RDF, RDFTerm, Triples)

# define a namespace

class Boo(Namespace):
    __iri__ = IRI("http://boo#")
    SomeClass = PrefixedName
    website = PrefixedName
    label = PrefixedName

# create a node

node = Node("<subject>", {
    RDF.type: Boo.SomeClass,
    Boo.website: IRI("http://example.org"),
    Boo.label: "some label", # "some label" will be automatically escaped
})

# missing prefixed names will show on your IDE and fail on execution

print(Boo.something) # AttributeError!

# create triples

triples = Triples([("s", "p", "o")]) # o is automatically escaped
triples.append(("s", Boo.website, IRI("http://example.org")))
triples.extend([("s", Boo.website, IRI("http://example.org"))])

print(triples) # print the triples is a format usable directly in a SPARQL
               # query. It also groups by subject automatically for you


from aiosparql.client import SPARQLClient

client = SPARQLClient("http://dbpedia.org/sparql")
result = await client.query("select * where {?s ?p ?o} limit 1")
# result is a dict of the JSON result
result = await client.update("""
    with {{graph}}
    insert data {
        {{}}
    }
    """, triples)
# the triples will be automatically indented to produce a beautiful query


from aiosparql.escape import escape_any

print(escape_any(True)) # "true"
print(escape_any("foo")) # "foo"
print(escape_any(5)) # "5"
print(escape_any(5.5)) # "5.5"^^xsd:doubleInstallationUser space installationeasy_install --user aiosparqlSystem wide installationeasy_install aiosparqlRequirementsPython >= 3.5TestingIn order for the tests to run, you must have the following Docker containers started:docker run -d --name travis-virtuoso -p 8890:8890 -e SPARQL_UPDATE=true tenforce/virtuoso:1.2.0-virtuoso7.2.2
docker run -d -p 3030:3030 --name travis-fuseki -e ADMIN_PASSWORD=PASSWORD -e ENABLE_DATA_WRITE=true -e ENABLE_UPDATE=true -e ENABLE_UPLOAD=true secoresearch/fusekiCreditsThis software has been produced byDacota One.
Package: aiospotipy
Aiospotipyaiospotipy is an API wrapper for Spotify written in python.This is based on asyncio and spotipy.InstallingThis package can be installed inpip:pip install aiospotipyOf course, you can install the package manually after cloning the repository:git clone https://github.com/sizumita/aiospotipy.git
cd aiospotipy
python setup.py installQuick ExamplefromaiospotipyimportSpotifyauth="xxxxxxxxxxxxxx"spotify=Spotify(auth=auth)# Search for an artist by its namesearch_results=awaitspotify.search_artist(q="kalafina")fromaiospotipyimportSpotifyfromaiospotipy.oauth2importSpotifyCredentialsspotify=Spotify(SpotifyCredentials("CLIENT_ID","CLIENT_SECRET"))# Search for an track by its idsearch_results=awaitspotify.search(q='3n3Ppam7vgaVa1iaRUc9Lp',_type='track')# Show my playlists:my_playlists=awaitspotify.me.playlists()LicenseThis project is licensed under the MIT Licence.
Package: aiosqlalchemy-miniorm
# Asynchronous SQLAlchemy Object Relational Mapper.This is an ORM for accessing SQLAlchemy using asyncio. Working on top of SQLAlchemy Core.It presents a method of associating user-defined Python classes with database tables, and instances of those classes (objects) with rows in their corresponding tables.## UsageInitialization:from sqlalchemy import MetaData, Integer, String, DateTimefrom aiopg.sa import create_enginefrom aiosqlalchemy_miniorm import RowModel, RowModelDeclarativeMeta, BaseModelManagermetadata = MetaData()BaseModel = declarative_base(metadata=metadata, cls=RowModel, metaclass=RowModelDeclarativeMeta)async def setup():metadata.bind = await create_engine(**database_settings)class MyEntityManager(BaseModelManager):async def get_with_products(self):return await self.get_items(where_list=[(MyEntity.c.num_products > 0)])class MyEntity(BaseModel):__tablename__ = 'my_entity'__model_manager_class__ = MyEntityManagerid = Column(Integer, primary_key=True)name = Column(String(100), nullable=False)num_products = Column(Integer)created_at = Column(DateTime(), server_default=text('now()'), nullable=False)Query:objects = await MyEntity.objects.get_instances(where_list=[(MyEntity.c.name == 'foo')],order_by=['name', '-num_products'])num_objects = await MyEntity.objects.count(where_list=[(MyEntity.c.name == 'foo'), (MyEntity.c.num_products > 3)])or (low-level):objects = await MyEntity.objects \.set_sql(MyEntity.table.select()) \.where([(MyEntity.c.name == 'foo')]) \.limit(10) \.fetchall()Management:record = await MyEntity.objects.insert(name='bar',num_products=0,)await record.update(name='baz')await record.delete()Transactions:async with MyEntity.objects.transaction() as my_entity_objects:await my_entity_objects.insert(name='bar', num_products=0)await my_entity_objects.delete([(MyEntity.c.name == 'foo')])
Package: aiosqlite
aiosqlite provides a friendly, async interface to sqlite databases.It replicates the standardsqlite3module, but with async versions
of all the standard connection and cursor methods, plus context managers for
automatically closing connections and cursors:asyncwithaiosqlite.connect(...)asdb:awaitdb.execute("INSERT INTO some_table ...")awaitdb.commit()asyncwithdb.execute("SELECT * FROM some_table")ascursor:asyncforrowincursor:...It can also be used in the traditional, procedural manner:db=awaitaiosqlite.connect(...)cursor=awaitdb.execute('SELECT * FROM some_table')row=awaitcursor.fetchone()rows=awaitcursor.fetchall()awaitcursor.close()awaitdb.close()aiosqlite also replicates most of the advanced features ofsqlite3:asyncwithaiosqlite.connect(...)asdb:db.row_factory=aiosqlite.Rowasyncwithdb.execute('SELECT * FROM some_table')ascursor:asyncforrowincursor:value=row['column']awaitdb.execute('INSERT INTO foo some_table')assertdb.total_changes>0Installaiosqlite is compatible with Python 3.8 and newer.
You can install it from PyPI:$pipinstallaiosqliteDetailsaiosqlite allows interaction with SQLite databases on the main AsyncIO event
loop without blocking execution of other coroutines while waiting for queries
or data fetches.  It does this by using a single, shared thread per connection.
This thread executes all actions within a shared request queue to prevent
overlapping actions.Connection objects are proxies to the real connections, contain the shared
execution thread, and provide context managers to handle automatically closing
connections.  Cursors are similarly proxies to the real cursors, and provide
async iterators to query results.Licenseaiosqlite is copyrightAmethyst Reese, and licensed under the
MIT license.  I am providing code in this repository to you under an open source
license.  This is my personal repository; the license you receive to my code
is from me and not from my employer. See theLICENSEfile for details.
Package: aiosqlite-custom
aiosqlite provides a friendly, async interface to sqlite databases.It replicates the standardsqlite3module, but with async versions
of all the standard connection and cursor methods, plus context managers for
automatically closing connections and cursors:asyncwithaiosqlite.connect(...)asdb:awaitdb.execute("INSERT INTO some_table ...")awaitdb.commit()asyncwithdb.execute("SELECT * FROM some_table")ascursor:asyncforrowincursor:...It can also be used in the traditional, procedural manner:db=awaitaiosqlite.connect(...)cursor=awaitdb.execute('SELECT * FROM some_table')row=awaitcursor.fetchone()rows=awaitcursor.fetchall()awaitcursor.close()awaitdb.close()aiosqlite also replicates most of the advanced features ofsqlite3:asyncwithaiosqlite.connect(...)asdb:db.row_factory=aiosqlite.Rowasyncwithdb.execute('SELECT * FROM some_table')ascursor:asyncforrowincursor:value=row['column']awaitdb.execute('INSERT INTO foo some_table')assertdb.total_changes>0Installaiosqlite is compatible with Python 3.8 and newer.
You can install it from PyPI:$pipinstallaiosqliteDetailsaiosqlite allows interaction with SQLite databases on the main AsyncIO event
loop without blocking execution of other coroutines while waiting for queries
or data fetches.  It does this by using a single, shared thread per connection.
This thread executes all actions within a shared request queue to prevent
overlapping actions.Connection objects are proxies to the real connections, contain the shared
execution thread, and provide context managers to handle automatically closing
connections.  Cursors are similarly proxies to the real cursors, and provide
async iterators to query results.Licenseaiosqlite is copyrightAmethyst Reese, and licensed under the
MIT license.  I am providing code in this repository to you under an open source
license.  This is my personal repository; the license you receive to my code
is from me and not from my employer. See theLICENSEfile for details.