Skip to main content

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 PyPI version shields.io PyPI pyversions

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

Production

Development

Usage

Installation

pip install aiorequest
✨ 🍰 ✨

Quick start

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

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

The package is also covered with the installation unit tests based on bats framework. Please run the following command to launch package unit tests:

bats --pretty test-package.bats

PACKAGE_NAME and PACKAGE_VERSION environment variables should be specified prelimirary.

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

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 page. If you have ideas you want to change/implement please do not hesitate and create an issue.

⬆ back to top

Metadata

Release files for aiorequest 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for aiorequest 0.0.2
File Interpreter ABI Platform
aiorequest-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / aiorequest-0.0.2-py3-none-any.whl

Download URL aiorequest-0.0.2-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84ea9e34c24a134dc7bef7cb9730b0a4ff2a4a6af2ec0dc3b2aaec6f07cee4b1
BLAKE2b-256 checksum
How to use checksums
17281ee00ab079c7f16d81cd76132b8e973d3d26738c2a0da35469fc9de65627
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page