async-client-decorator
Warning
This package has been renamed fromasync-client-decoratorto ahttp-client
Usepip install ahttp_clientinstead.New package: https://pypi.org/p/ahttp-client
Using @decorator to easily request an HTTP Client
This framework based on aiohttp's http client framework.
Use Annotated Type to describe the elements required in an HTTP request.
Installation
Python 3.10 or higher is required.
pip install ahttp-client
Quick Example
An example is the API provided by the BUS API.
import asyncio
import aiohttp
from ahttp_client import request, Session, Query
from typing import Any
loop = asyncio.get_event_loop()
class MetroAPI(Session):
def __init__(self, loop: asyncio.AbstractEventLoop):
super().__init__("https://api.yhs.kr", loop=loop)
@request("GET", "/metro/station")
async def station_search_with_query(
self,
response: aiohttp.ClientResponse,
name: Query | str
) -> dict[str, Any]:
return await response.json()
async def main():
async with MetroAPI(loop) as client:
data = await client.station_search_with_query(name="metro-station-name")
print(len(data))
loop.run_until_complete(main())
Metadata
Release files for async-client-decorator 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| async_client_decorator-1.0.0.tar.gz | 3.0 kB | Without provenance | Details for async_client_decorator-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| async_client_decorator-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for async_client_decorator-1.0.0-py3-none-any.whl |
Total release size: 6.9 kB
Release files / async_client_decorator-1.0.0.tar.gz
| Download URL | async_client_decorator-1.0.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ca1a8fb067fdb6ef9875e0ca1637aac11796e4ae163b56154cceb45c1f8c939
|
|
BLAKE2b-256 checksum How to use checksums |
1f5f2d87f9d99abf85d40ba04e7f68ebb0c3bec6595507a17af73c54430f4fd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / async_client_decorator-1.0.0-py3-none-any.whl
| Download URL | async_client_decorator-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63ef17685ca25ddacf22563da5e30cb217716549367ed350b666b81f030e02bf
|
|
BLAKE2b-256 checksum How to use checksums |
e452d54296acf9b36d1f5be159337652533861a068771e5744301dc58fcfc3f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for async-client-decorator 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.