Metadata-Version: 2.4
Name: ahttp_client
Version: 1.0.5
Summary: A framework for easy asynchronous HTTP request calling with decorations
Author-email: gunyu1019 <gunyu1019@yhs.kr>
License: MIT License
        
        Copyright (c) 2023-present gunyu1019
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/gunyu1019/ahttp-client
Project-URL: Issue Tracker, https://github.com/gunyu1019/ahttp-client/issues
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.11.2
Requires-Dist: aiosignal>=1.3.2
Requires-Dist: async-timeout>=5.0.1
Requires-Dist: attrs>=25.1.0
Requires-Dist: charset-normalizer>=3.4.1
Requires-Dist: frozenlist>=1.5.0
Requires-Dist: idna>=3.10
Requires-Dist: multidict>=6.1.0
Requires-Dist: yarl>=1.17.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: lint
Requires-Dist: pycodestyle; extra == "lint"
Requires-Dist: black; extra == "lint"
Provides-Extra: docs
Requires-Dist: Sphinx; extra == "docs"
Requires-Dist: sphinxawesome-theme; extra == "docs"
Requires-Dist: sphinx-intl; extra == "docs"
Dynamic: license-file

 # ahttp-client
 
![PyPI - Version](https://img.shields.io/pypi/v/ahttp-client?style=flat)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ahttp-client?style=flat)
![PyPI - License](https://img.shields.io/pypi/l/ahttp-client?style=flat)

An ahttp-client is Python package that provides concise and aintuitive asynchronous HTTP request using [annotated type](https://docs.python.org/ko/3.9/library/typing.html#typing.Annotated) and `@decorator`. 

**Key Feautre**
- Defining a simple request method with decoration.
- Managing HTTP Compoents using Annotated Types.
- Providing Hooks before and after HTTP calls.

## Getting Started

Implement a `GithubService` class extended with `ahttp_client.Session`. 
Then, create a `list_repositories` method using a request decorator.

An `user` argument define HTTP-component (Path) through annotation types.

```python
class GithubService(Session):
    def __init__(self):
        super().__init__("https://api.github.com")

    @request("GET", "/users/{user}/repos")
    def list_repositories(
        user: Annotated[str, Path]
    ) -> dict[str, Any]:
        return 
```

Using the asynchronous context manager(`async with`), create a GithubService instance.

```python
async with GithubService() as service:
    result = await service.list_repoisitories(user = "gunyu1019")
    print(result)
```

Client Session in GithubServices are terminated when leave the asynchronous context manager.

## Documentaion
* English: https://gunyu1019.github.io/ahttp-client/en/
* Korean: https://gunyu1019.github.io/ahttp-client/ko/
