Metadata-Version: 2.1
Name: async-client-decorator
Version: 0.1.1
Summary: A framework for easy asynchronous HTTP request calling with decorations
Home-page: https://github.com/gunyu1019/async-client-decorator
Author: gunyu1019
Author-email: gunyu1019@yhs.kr
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: Korean
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp (==3.8.6)
Requires-Dist: aiosignal (==1.3.1)
Requires-Dist: async-timeout (==4.0.3)
Requires-Dist: attrs (==23.1.0)
Requires-Dist: charset-normalizer (==3.3.1)
Requires-Dist: frozenlist (==1.4.0)
Requires-Dist: idna (==3.4)
Requires-Dist: multidict (==6.0.4)
Requires-Dist: yarl (==1.9.2)

 # async-client-decorator

Using `@decorator` to esaily request an HTTP Client<br/>
This framework based on [aiohttp](https://github.com/aio-libs/aiohttp)'s http client framework.<br/>

Use Union Type to describe the elements required in an HTTP request.


## Installation
**Python 3.10 or higher is required.**

```pip
pip install async-client-decorator
```

## Quick Example

An example is the API provided by the [BUS API](https://github.com/gunyu1019/trafficAPI).
```python
import asyncio
import aiohttp
from async_client_decorator import request, Session, Query

loop = asyncio.get_event_loop()


class BusAPI(Session):
    def __init__(self, loop: asyncio.AbstractEventLoop):
        super().__init__("https://api.yhs.kr", loop)

    @request("GET", "/bus/station")
    async def station_search_with_query(
                self,
                response: aiohttp.ClientResponse,
                name: Query | str
    ):
        return await response.json() 


async def main():
    async with BusAPI(loop) as client:
        response = await client.station_search_with_query(name="bus-station-name")
        data = await response.json()
        print(len)

loop.run_until_complete(main())
```
