Skip to main content

No project description provided

Project description

Gufo HTTP

The accelerated Python HTTP client library.

PyPi version Python Versions License Build Sponsors Ruff


Documentation: https://docs.gufolabs.com/gufo_http/

Source Code: https://github.com/gufolabs/gufo_http/


Gufo HTTP is a high-performance Python HTTP client library that handles both asynchronous and synchronous modes. It wraps famous Reqwest HTTP client, written in Rust language with PyO3 wrapper. Our task is to reach maximal performance while maintaining clean and easy-to use API.

The getting of single URL is a simple task:

async with HttpClient() as client:
    resp = client.get("https://docs.gufolabs.com/")
    assert resp.status == 200
    data = resp.content

The HttpClient is highly customizable, for example, to set request headers:

async with HttpClient(headers={"X-My-Header": b"test"}) as client:
    resp = client.get("https://docs.gufolabs.com/")
    ...

The response headers processing as easy as working with dicts:

async with HttpClient(headers={"X-My-Header": b"test"}) as client:
    resp = client.get("https://docs.gufolabs.com/")
    if resp.headers["Content-Type"] == "text/html":
        ...

Gufo HTTP supports common authentication methods out-of-box:

async with HttpClient(auth=BasicAuth("scott", "tiger")) as client:
    resp = client.get("https://protected.example.com/")
    ...

Features

  • Clean async and blocking API.
  • High performance (see Performance section for details).
  • Built with security in mind.
  • Customizabile redirect policy.
  • TLS support.
  • Basic and bearer authorization schemes.
  • HTTP/HTTPS/SOCKS5 Proxy support.
  • Full Python typing support.
  • Editor completion.
  • Well-tested, battle-proven code.

Performance

Gufo HTTP is proved to be one of the fastest Python HTTP client available in the various scenarios. For example:

Single HTTP/1.1 requests scenario

Single requests Lower is better

100 Linear HTTP/1.1 requests scenario

Linear requests Lower is better

100 Parallel HTTP/1.1 requests scenario

Parallel requests Lower is better

Single HTTPS requests scenario

Single requests Lower is better

100 Linear HTTPS requests scenario

Linear requests Lower is better

100 Parallel HTTPS requests scenario

Parallel requests Lower is better

Refer to benchmarks for details.

On Gufo Stack

This product is a part of Gufo Stack - the collaborative effort led by Gufo Labs. Our goal is to create a robust and flexible set of tools to create network management software and automate routine administration tasks.

To do this, we extract the key technologies that have proven themselves in the NOC and bring them as separate packages. Then we work on API, performance tuning, documentation, and testing. The NOC uses the final result as the external dependencies.

Gufo Stack makes the NOC better, and this is our primary task. But other products can benefit from Gufo Stack too. So we believe that our effort will make the other network management products better.

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

gufo_http-0.3.0.tar.gz (19.7 kB view hashes)

Uploaded Source

Built Distributions

gufo_http-0.3.0-cp312-cp312-manylinux_2_28_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

gufo_http-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

gufo_http-0.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

gufo_http-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

gufo_http-0.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

gufo_http-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

gufo_http-0.3.0-cp39-cp39-manylinux_2_28_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

gufo_http-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

gufo_http-0.3.0-cp38-cp38-manylinux_2_28_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

gufo_http-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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