No project description provided
Project description
Reqsnaked
Reqsnaked is a blazing fast async/await HTTP client for Python written on Rust using reqwests.
- Works 15% faster than
aiohttp
on average - RAII approach without context managers
- Memory-efficient lazy JSON parser
- Fully-typed even being written on Rust
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
Release history Release notifications | RSS feed
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_beta0.tar.gz
(553.4 kB
view hashes)
Built Distributions
Close
Hashes for reqsnaked-0.1.0b0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c65361bdeb6d5745344878e67d2320b22a7f825de0c5a0f915446e9004c3ea3e |
|
MD5 | fe641085fc351751f26fa33789ed7f01 |
|
BLAKE2b-256 | 5d57b0557673f0401a1fbe689f9c7b2685d067d24b82d6b07b8e71881f02082f |
Close
Hashes for reqsnaked-0.1.0_beta0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0786fc2796038ec42b03670c9acf6262f583a68b0f5b120c592d16c1f2c6f5 |
|
MD5 | 0005e039e1322452efb636fdde7bcd3e |
|
BLAKE2b-256 | a32e8a652f5e0ddce26b2bf2b65a09889489e92248c826597b2e798345919851 |
Close
Hashes for reqsnaked-0.1.0_beta0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a68d1686fbed5e78342b001296606cef7a80c5019ae415481b0f5852d7d361a0 |
|
MD5 | 32dde3a4b0c5f7e9ac0fa2386f6a45ce |
|
BLAKE2b-256 | 4f276ddff5158a7ecbfdf66702a3620210b8d6c3e4e4f9abb5866c78f3276939 |
Close
Hashes for reqsnaked-0.1.0_beta0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b0c2ef4ef4a111cc5997ebe642c393ff6b43d5297952edc2a20ec37631586bd |
|
MD5 | e88d353d8e43817704da3337349043c9 |
|
BLAKE2b-256 | 45cc69ed18d3f43c80827a2bfbbdfccd87a86715826b14a4d087ad47c83d6037 |