aiorequest-0.0.2
توضیحات
Package provides asynchronous user-friendly HTTP client with clean objects.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aiorequest-0.0.2 |
| نام | aiorequest |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Volodymyr Yahello |
| ایمیل نویسنده | vyahello@gmail.com |
| آدرس صفحه اصلی | https://github.com/aiorequest/aiorequest |
| آدرس اینترنتی | https://pypi.org/project/aiorequest/ |
| مجوز | - |
[](https://www.python.org/)
[](https://travis-ci.org/aiopymake/aiorequest)
[](https://coveralls.io/github/aiopymake/aiorequest?branch=master)
[](https://github.com/psf/black)
[](https://www.pylint.org)
[](http://flake8.pycqa.org/)
[](http://www.pydocstyle.org/)
[](https://interrogate.readthedocs.io/en/latest/)
[](http://mypy-lang.org/)
[](LICENSE.md)
[](https://www.elegantobjects.org)
[](https://www.codefactor.io/repository/github/aiopymake/aiorequest)
[](https://pypi.python.org/pypi/aiorequest/)
[](https://pypi.python.org/pypi/aiorequest/)
# aioRequest
> Provides asynchronous user-friendly micro HTTP client with nothing but clean objects.
> Basically, it is a wrapper over **requests** python library with async/await approach.
> Represents asynchronous version of [urequest](https://upymake.github.io/urequest/) package.
## Tools
### Production
- python 3.7, 3.8
- [asyncio](https://docs.python.org/3/library/asyncio.html) library
- [requests](https://requests.readthedocs.io/en/master) library
### Development
- [travis](https://travis-ci.org/) CI
- [pytest](https://pypi.org/project/pytest/)
- [black](https://black.readthedocs.io/en/stable/)
- [mypy](http://mypy.readthedocs.io/en/latest)
- [pylint](https://www.pylint.org/)
- [flake8](http://flake8.pycqa.org/en/latest/)
- [pydocstyle](https://github.com/PyCQA/pydocstyle)
- [interrogate](https://interrogate.readthedocs.io/en/latest)
- [bats](https://github.com/bats-core/bats-core)
## Usage
### Installation
```bash
pip install aiorequest
✨ 🍰 ✨
```
### Quick start
```python
>>> import asyncio
>>> from typing import Tuple
>>> from aiorequest.sessions import Session, HttpSession
>>> from aiorequest.responses import HTTPStatus, Response, JsonType
>>> from aiorequest.urls import HttpUrl
>>>
>>>
>>> async def aioresponse() -> Tuple[HTTPStatus, JsonType]:
... session: Session
... async with HttpSession() as session:
... response: Response = await session.get(
... HttpUrl(host="xkcd.com", path="info.0.json")
... )
... return await response.status(), await response.as_json()
...
...
>>>
>>> asyncio.run(aioresponse())
(
<HTTPStatus.OK: 200>,
{
"month": "3",
"num": 2284,
"link": "",
"year": "2020",
"news": "",
"safe_title": "Sabotage",
"transcript": "",
"img": "https://imgs.xkcd.com/comics/sabotage.png",
"title": "Sabotage",
"day": "23",
}
)
```
### Source code
```bash
git clone git@github.com:aiopymake/aiorequest.git
python setup.py install
```
Or using specific release:
```bash
pip install git+https://github.com/aiopymake/aiorequest@0.0.1
```
### Local debug
```bash
git clone git@github.com:aiopymake/aiorequest.git
```
```python
>>> import aiorequest
>>> aiorequest.__doc__
'Package provides asynchronous user-friendly HTTP client with clean objects.'
```
**[⬆ back to top](#aiorequest)**
## Development notes
### Testing
Generally, `pytest` tool is used to organize testing procedure.
Please follow next command to run unittests:
```bash
pytest
```
### CI
Project has Travis CI integration using [.travis.yml](.travis.yml) file thus code analysis (`black`, `pylint`, `flake8`, `mypy`, `pydocstyle` and `interrogate`) and unittests (`pytest`) will be run automatically after every made change to the repository.
To be able to run code analysis, please execute command below:
```bash
./analyse-source-code.sh
```
The package is also covered with the installation unit tests based on [bats](https://github.com/bats-core/bats-core) framework. Please run the following command to launch package unit tests:
```bash
bats --pretty test-package.bats
```
> `PACKAGE_NAME` and `PACKAGE_VERSION` environment variables should be specified prelimirary.
### Release notes
Please check [changelog](CHANGELOG.md) file to get more details about actual versions and it's release notes.
### Meta
Author – _Volodymyr Yahello_. Please check [AUTHORS](AUTHORS.md) file for all contributors.
Distributed under the `MIT` license. See [LICENSE](LICENSE.md) for more information.
You can reach out me at:
* [vyahello@gmail.com](vyahello@gmail.com)
* [https://twitter.com/vyahello](https://twitter.com/vyahello)
* [https://www.linkedin.com/in/volodymyr-yahello-821746127](https://www.linkedin.com/in/volodymyr-yahello-821746127)
### Contributing
I would highly appreciate any contribution and support. If you are interested to add your ideas into project please follow next simple steps:
1. Clone the repository
2. Configure `git` for the first time after cloning with your `name` and `email`
3. `pip install -r requirements.txt` to install all project dependencies
4. `pip install -r requirements-dev.txt` to install all development project dependencies
5. Create your feature branch (git checkout -b feature/fooBar)
6. Commit your changes (git commit -am 'Add some fooBar')
7. Push to the branch (git push origin feature/fooBar)
8. Create a new Pull Request
### What's next
All recent activities and ideas are described at project [issues](https://github.com/aiopymake/aiorequest/issues) page.
If you have ideas you want to change/implement please do not hesitate and create an issue.
**[⬆ back to top](#aiorequest)**
نیازمندی
| مقدار | نام |
|---|---|
| ==19.3.0 | attrs |
| ==3.1.5 | bleach |
| ==2020.4.5.1 | certifi |
| ==3.0.4 | chardet |
| ==7.1.1 | click |
| ==0.6 | dataclasses |
| ==0.16 | docutils |
| ==2.9 | idna |
| ==21.2.1 | keyring |
| ==20.4 | packaging |
| ==1.5.0.1 | pkginfo |
| ==2.6.1 | Pygments |
| ==2.4.7 | pyparsing |
| ==5.3.1 | PyYAML |
| ==26.0 | readme-renderer |
| ==2.23.0 | requests |
| ==0.9.1 | requests-toolbelt |
| ==1.15.0 | six |
| ==1.1.0 | termcolor |
| ==4.46.0 | tqdm |
| ==3.1.1 | twine |
| ==1.25.9 | urllib3 |
| ==0.5.1 | webencodings |
| ==0.0.8 | enforce-pep8 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aiorequest-0.0.2:
pip install aiorequest-0.0.2.whl
نصب پکیج tar.gz aiorequest-0.0.2:
pip install aiorequest-0.0.2.tar.gz