httpr 0.1.0__cp39-abi3-win_amd64.whl → 0.1.11__cp39-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of httpr might be problematic. Click here for more details.
- httpr/__init__.py +14 -0
- httpr/httpr.pyd +0 -0
- {httpr-0.1.0.dist-info → httpr-0.1.11.dist-info}/METADATA +17 -11
- httpr-0.1.11.dist-info/RECORD +8 -0
- httpr-0.1.0.dist-info/RECORD +0 -8
- {httpr-0.1.0.dist-info → httpr-0.1.11.dist-info}/WHEEL +0 -0
- {httpr-0.1.0.dist-info → httpr-0.1.11.dist-info}/licenses/LICENSE +0 -0
httpr/__init__.py
CHANGED
|
@@ -80,6 +80,10 @@ class Client(RClient):
|
|
|
80
80
|
# Validate the HTTP method. Raise an exception if it's not supported.
|
|
81
81
|
if method not in ["GET", "HEAD", "OPTIONS", "DELETE", "POST", "PUT", "PATCH"]:
|
|
82
82
|
raise ValueError(f"Unsupported HTTP method: {method}")
|
|
83
|
+
# Convert all params values to strings if params is present
|
|
84
|
+
if "params" in kwargs and kwargs["params"] is not None:
|
|
85
|
+
kwargs["params"] = {k: str(v) for k, v in kwargs["params"].items()}
|
|
86
|
+
|
|
83
87
|
return super().request(method=method, url=url, **kwargs)
|
|
84
88
|
|
|
85
89
|
def get(self, url: str, **kwargs: Unpack[RequestParams]) -> Response:
|
|
@@ -114,11 +118,21 @@ class AsyncClient(Client):
|
|
|
114
118
|
async def __aexit__(self, *args):
|
|
115
119
|
del self
|
|
116
120
|
|
|
121
|
+
async def aclose(self):
|
|
122
|
+
del self
|
|
123
|
+
return
|
|
124
|
+
|
|
117
125
|
async def _run_sync_asyncio(self, fn, *args, **kwargs):
|
|
118
126
|
loop = asyncio.get_running_loop()
|
|
119
127
|
return await loop.run_in_executor(None, partial(fn, *args, **kwargs))
|
|
120
128
|
|
|
121
129
|
async def request(self, method: HttpMethod, url: str, **kwargs: Unpack[RequestParams]): # type: ignore
|
|
130
|
+
if method not in ["GET", "HEAD", "OPTIONS", "DELETE", "POST", "PUT", "PATCH"]:
|
|
131
|
+
raise ValueError(f"Unsupported HTTP method: {method}")
|
|
132
|
+
# Convert all params values to strings if params is present
|
|
133
|
+
if "params" in kwargs and kwargs["params"] is not None:
|
|
134
|
+
kwargs["params"] = {k: str(v) for k, v in kwargs["params"].items()}
|
|
135
|
+
|
|
122
136
|
return await self._run_sync_asyncio(super().request, method=method, url=url, **kwargs)
|
|
123
137
|
|
|
124
138
|
async def get(self, url: str, **kwargs: Unpack[RequestParams]): # type: ignore
|
httpr/httpr.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: httpr
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -22,7 +22,7 @@ Requires-Dist: mypy>=1.14.1 ; extra == 'dev'
|
|
|
22
22
|
Requires-Dist: ruff>=0.9.2 ; extra == 'dev'
|
|
23
23
|
Requires-Dist: maturin ; extra == 'dev'
|
|
24
24
|
Requires-Dist: trustme ; extra == 'dev'
|
|
25
|
-
Requires-Dist: mkdocs-material ; extra == 'docs'
|
|
25
|
+
Requires-Dist: mkdocs-material[imaging] ; extra == 'docs'
|
|
26
26
|
Requires-Dist: httpr[dev] ; extra == 'scratch'
|
|
27
27
|
Requires-Dist: matplotlib ; extra == 'scratch'
|
|
28
28
|
Requires-Dist: pandas ; extra == 'scratch'
|
|
@@ -47,19 +47,24 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
|
47
47
|
|
|
48
48
|
# httpr
|
|
49
49
|
|
|
50
|
-
**Blazing fast http-client** for Python in Rust 🦀 that can be used as drop-in replacement for `httpx` in most cases.
|
|
50
|
+
**Blazing fast http-client** for Python in Rust 🦀 that can be used as drop-in replacement for `httpx` and `requests` in most cases.
|
|
51
51
|
|
|
52
|
-
- **Fast**: httpr is built on top of `reqwests
|
|
53
|
-
- **Both async and sync**: httpr provides both a sync and async client.
|
|
54
|
-
- **Lightweight**: httpr is a lightweight http client with
|
|
55
|
-
- **Async**: first-class support
|
|
56
|
-
- **http2**: httpr supports
|
|
57
|
-
- **mTLS**: httpr supports mTLS.
|
|
58
|
-
|
|
52
|
+
- **Fast**: `httpr` is built on top of `reqwests`, which is a blazing fast http client in Rust. Check out the [benchmark](#benchmark).
|
|
53
|
+
- **Both async and sync**: `httpr` provides both a sync and async client.
|
|
54
|
+
- **Lightweight**: `httpr` is a lightweight http client with zero python-dependencies.
|
|
55
|
+
- **Async**: first-class async support.
|
|
56
|
+
- **http2**: `httpr` supports HTTP/2.
|
|
57
|
+
- **mTLS**: `httpr` supports mTLS.
|
|
58
|
+
|
|
59
|
+
## Not implemented yet
|
|
60
|
+
|
|
61
|
+
- **Streaming**: Streaming is not implemented yet.
|
|
62
|
+
- **Fine-grained error handling**: Fine-grained error handling is not implemented yet.
|
|
59
63
|
|
|
60
64
|
## Table of Contents
|
|
61
65
|
|
|
62
66
|
- [httpr](#httpr)
|
|
67
|
+
- [Not implemented yet](#not-implemented-yet)
|
|
63
68
|
- [Table of Contents](#table-of-contents)
|
|
64
69
|
- [Installation](#installation)
|
|
65
70
|
- [Install with uv](#install-with-uv)
|
|
@@ -310,7 +315,8 @@ Provides precompiled wheels for the following platforms:
|
|
|
310
315
|
|
|
311
316
|
## Acknowledgements
|
|
312
317
|
|
|
313
|
-
- [
|
|
318
|
+
- [uv](https://docs.astral.sh/uv/): The package manager used, and for leading the way in the "Rust for python tools"-sphere.
|
|
319
|
+
- [primp](https://github.com/deedy5/primp): *A lot* of code is borrowed from primp, that wraps rust library `rquest` for python in a similar way. If primp supported mTLS, I would have used it instead.
|
|
314
320
|
- [reqwests](https://github.com/seanmonstar/reqwest): The rust library that powers httpr.
|
|
315
321
|
- [pyo3](https://github.com/PyO3/pyo3)
|
|
316
322
|
- [maturin](https://github.com/PyO3/maturin)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
httpr-0.1.11.dist-info/METADATA,sha256=doh3nOgUjWooiCdX8u2aixRS_APen0cA789M7cbf3G0,12661
|
|
2
|
+
httpr-0.1.11.dist-info/WHEEL,sha256=R8ZEnni7m2eO5M7FTZ3FjvjlbxsclsOWT9kw6XK1Agc,94
|
|
3
|
+
httpr-0.1.11.dist-info/licenses/LICENSE,sha256=O15TIxUAXq6sSpPu0K3CJu_dT5ZzCgIk7hQtZsf0lEk,1084
|
|
4
|
+
httpr/httpr.pyi,sha256=VbROFo3ZXTacg2Fe0kvQWZ0RXXrAK08F4ivUL0cvGtY,3830
|
|
5
|
+
httpr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
httpr/__init__.py,sha256=aw67KgR-pBu9cLVJGN0f28lGEV9bgeJC-7jffFZfKO4,9496
|
|
7
|
+
httpr/httpr.pyd,sha256=gD9XXBpYWFxlO-hAk1ztb5OcOZWUt0hLhcyOlJHGql0,4551168
|
|
8
|
+
httpr-0.1.11.dist-info/RECORD,,
|
httpr-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
httpr-0.1.0.dist-info/METADATA,sha256=QCm1NtyBhldWbNhFEZwp6KaOuoUlIYVQ5f_lu6OLT28,12325
|
|
2
|
-
httpr-0.1.0.dist-info/WHEEL,sha256=R8ZEnni7m2eO5M7FTZ3FjvjlbxsclsOWT9kw6XK1Agc,94
|
|
3
|
-
httpr-0.1.0.dist-info/licenses/LICENSE,sha256=O15TIxUAXq6sSpPu0K3CJu_dT5ZzCgIk7hQtZsf0lEk,1084
|
|
4
|
-
httpr/httpr.pyi,sha256=VbROFo3ZXTacg2Fe0kvQWZ0RXXrAK08F4ivUL0cvGtY,3830
|
|
5
|
-
httpr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
httpr/__init__.py,sha256=mJu6IccmRh6mzdliCqwFnQtpsYuKYPpeTvvcuYqQBdw,8833
|
|
7
|
-
httpr/httpr.pyd,sha256=fuRxnteKqCmw5LP4iCo13HS-AY8Gjhjsv9iJRdRSwLw,4543488
|
|
8
|
-
httpr-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|