Skip to main content

A lightweight asyncio HTTP client

Project description

bareClient

An asyncio HTTP Python client package supporting HTTP versions 1.0, 1.1 and 2 (read the docs).

This is the client companion to the ASGI server side web framework bareASGI and follows the same "bare" approach. It provides only the essential functionality and makes little attempt to provide any helpful features which might do unnecessary work.

This package is suitable for:

  • A foundation for async HTTP/2 clients,
  • Async REST client API's,
  • Containers requiring a small image size,
  • Integration with ASGI web servers requiring async HTTP client access.

Features

The client has the following notable features:

  • Lightweight
  • Uses asyncio
  • Supports HTTP versions 1.0, 1.1, 2
  • Supports middleware

Installation

The package can be installed with pip.

pip install bareclient

This is a Python3.7 and later package.

It has dependencies on:

Usage

The basic usage is to create an HttpClient.

import asyncio
from typing import List, Optional
from bareclient import HttpClient

async def main(url: str) -> None:
    async with HttpClient(url) as response:
        if response.ok and response.more_body:
            async for part in response.body:
                print(part)

asyncio.run(main('https://docs.python.org/3/library/cgi.html'))

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

bareclient-5.0.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bareclient-5.0.1-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file bareclient-5.0.1.tar.gz.

File metadata

  • Download URL: bareclient-5.0.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.7 Darwin/19.6.0

File hashes

Hashes for bareclient-5.0.1.tar.gz
Algorithm Hash digest
SHA256 ccfae9f5cb19a273a76a0b521dd371517757399dcb5c61f2f1b7c49ac00753ec
MD5 43aab75cf7357229597b3321014d435d
BLAKE2b-256 af6b23268543c1698b07fb5ab4765fa8e2d0f11c28cd9a0037cfc6a009b8621e

See more details on using hashes here.

File details

Details for the file bareclient-5.0.1-py3-none-any.whl.

File metadata

  • Download URL: bareclient-5.0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.7 Darwin/19.6.0

File hashes

Hashes for bareclient-5.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1e89260d383b249e5885065926d2307c4df92d44e10fb5c9bc77d8976582456
MD5 2dd1e571577c2083c90f8efe82dd7dac
BLAKE2b-256 fe0d539d30fa83937c541f6b42ebf5f10a576e0599dcdce4af9f49c58c59e8f2

See more details on using hashes here.

Supported by

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