Skip to main content

No project description provided

Project description

Reqsnaked

Reqsnaked is a blazing fast async/await HTTP client for Python written on Rust using reqwests.


Docs: https://deknowny.github.io/reqsnaked/devel/

Overview

import asyncio
import datetime

import reqsnaked


async def main():
    client = reqsnaked.Client(
        user_agent="Reqsnaked/1.0",
        headers={"X-Foo": "bar"},
        store_cookie=True
    )
    request = reqsnaked.Request(
        "POST", "https://httpbin.org/anything",
        multipart=reqsnaked.Multipart(
            reqsnaked.Part(
                "foo", b"01010101",
                filename="foo.txt",
                mime="text/plain"
            )
        ),
        query={"foo": "bar"},
        headers={"X-Bar": "foo"},
        timeout=datetime.timedelta(seconds=30),
    )
    response = await client.send(request)
    print(response.status)
    data = await response.json()
    data.show()


asyncio.run(main())
HTTPStatus.OK
{
  "args": {
    "foo": "bar"
  },
  "data": "",
  "files": {
    "foo": "01010101"
  },
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, br",
    "Content-Length": "246",
    "Content-Type": "multipart/form-data; boundary=a59212f1bfcc112f-b3b83c8afd39b140-f302f74df067620a-a8a38a37c3355abe",
    "Host": "httpbin.org",
    "User-Agent": "Reqsnaked/1.0",
    "X-Amzn-Trace-Id": "Root=1-63fcfd9b-412668b5117367524668f43b",
    "X-Bar": "foo",
    "X-Foo": "bar"
  },
  "json": null,
  "method": "POST",
  "origin": "1.1.1.1",
  "url": "https://httpbin.org/anything?foo=bar"
}

Installlation

Currently the library is not published to PyPI, so the only way to install it is from GitHub:

python -m pip install -U https://github.com/deknowny/reqsnaked/archive/main.zip

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

reqsnaked-0.1.0_beta1.tar.gz (553.4 kB view hashes)

Uploaded Source

Built Distributions

reqsnaked-0.1.0b1-cp38-none-win_amd64.whl (2.8 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

reqsnaked-0.1.0_beta1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

reqsnaked-0.1.0_beta1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

reqsnaked-0.1.0_beta1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.3 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

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