Skip to main content

Package provides asynchronous user-friendly HTTP client with clean objects.

Project description

Screenshot

made-with-python Build Status Coverage Status Code style: black Checked with pylint Checked with flake8 Checked with pydocstyle Checked with interrogate Checked with mypy License EO principles respected here CodeFactor

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 package.

Tools

Usage

Installation

pip install aiorequest
✨ 🍰 

Quick start

>>> import asyncio
>>> from aiorequest.sessions import Session, HttpSession
>>> from aiorequest.responses import Response
>>> from aiorequest.urls import HttpUrl
>>>
>>>
>>> async def aioresponse() -> None:
...     session: Session
...     async with HttpSession() as session:
...         response: Response = await session.get(HttpUrl(host="xkcd.com", path="info.0.json"))
...         print(await response.is_ok())
...         print(await response.as_json())
...
>>>
>>> asyncio.run(aioresponse())
True
{
    "month": "3",
    "num": 2284,
    "link": "",
    "year": "2020",
    "news": "",
    "safe_title": "Sabotage",
    "transcript": "",
    "alt": "So excited to see everyone after my cruise home from the World Handshake Championships!",
    "img": "https://imgs.xkcd.com/comics/sabotage.png",
    "title": "Sabotage",
    "day": "23",
}

Source code

git clone git@github.com:aiopymake/aiorequest.git
python setup.py install

Or using specific release:

pip install git+https://github.com/aiopymake/aiorequest@0.0.1

Local debug

git clone git@github.com:aiopymake/aiorequest.git
>>> import aiorequest
>>> aiorequest.__doc__
'Package provides asynchronous user-friendly HTTP client with clean objects.'

⬆ back to top

Development notes

Testing

Generally, pytest tool is used to organize testing procedure.

Please follow next command to run unittests:

pytest

CI

Project has Travis CI integration using .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:

./analyse-source-code.sh

Release notes

Please check changelog file to get more details about actual versions and it's release notes.

Meta

Author – Volodymyr Yahello. Please check AUTHORS file for all contributors.

Distributed under the MIT license. See LICENSE for more information.

You can reach out me at:

Contributing

  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

⬆ back to top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiorequest-0.0.1.tar.gz (271.2 kB view hashes)

Uploaded Source

Built Distribution

aiorequest-0.0.1-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page