lothc 0.2.2__tar.gz → 0.2.3__tar.gz

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.
Files changed (54) hide show
  1. {lothc-0.2.2 → lothc-0.2.3}/PKG-INFO +17 -16
  2. {lothc-0.2.2 → lothc-0.2.3}/README.md +2 -2
  3. {lothc-0.2.2 → lothc-0.2.3}/lothc/__init__.py +34 -17
  4. lothc-0.2.3/lothc/_client.py +1609 -0
  5. {lothc-0.2.2 → lothc-0.2.3}/lothc/_compat.py +2 -2
  6. lothc-0.2.3/lothc/_decode.py +401 -0
  7. lothc-0.2.3/lothc/_encode.py +121 -0
  8. lothc-0.2.3/lothc/_errors.py +266 -0
  9. lothc-0.2.3/lothc/_form.py +252 -0
  10. lothc-0.2.3/lothc/_headers.py +250 -0
  11. lothc-0.2.3/lothc/_mocking.py +679 -0
  12. lothc-0.2.3/lothc/_native.pyi +376 -0
  13. lothc-0.2.3/lothc/_native_loop.py +230 -0
  14. {lothc-0.2.2 → lothc-0.2.3}/lothc/_oauth.py +4 -1
  15. lothc-0.2.3/lothc/_response.py +61 -0
  16. lothc-0.2.3/lothc/_retry.py +141 -0
  17. lothc-0.2.3/lothc/_settings.py +136 -0
  18. lothc-0.2.3/lothc/_sse.py +362 -0
  19. lothc-0.2.3/lothc/_streaming.py +524 -0
  20. lothc-0.2.3/lothc/_sync_client.py +1665 -0
  21. lothc-0.2.3/lothc/_transport_native.py +1823 -0
  22. lothc-0.2.3/lothc/_transport_pyreqwest.py +1427 -0
  23. lothc-0.2.3/lothc/_types.py +99 -0
  24. lothc-0.2.3/lothc/testing.py +430 -0
  25. lothc-0.2.3/native/Cargo.lock +1577 -0
  26. lothc-0.2.3/native/Cargo.toml +70 -0
  27. lothc-0.2.3/native/build.rs +6 -0
  28. lothc-0.2.3/native/src/body.rs +113 -0
  29. lothc-0.2.3/native/src/connect.rs +226 -0
  30. lothc-0.2.3/native/src/cookie.rs +89 -0
  31. lothc-0.2.3/native/src/decompress.rs +349 -0
  32. lothc-0.2.3/native/src/error.rs +58 -0
  33. lothc-0.2.3/native/src/headers.rs +35 -0
  34. lothc-0.2.3/native/src/idle.rs +48 -0
  35. lothc-0.2.3/native/src/io.rs +389 -0
  36. lothc-0.2.3/native/src/lib.rs +107 -0
  37. lothc-0.2.3/native/src/limit.rs +226 -0
  38. lothc-0.2.3/native/src/mock.rs +171 -0
  39. lothc-0.2.3/native/src/multipart.rs +222 -0
  40. lothc-0.2.3/native/src/pool.rs +2004 -0
  41. lothc-0.2.3/native/src/proxy.rs +618 -0
  42. lothc-0.2.3/native/src/redirect.rs +174 -0
  43. lothc-0.2.3/native/src/request.rs +797 -0
  44. lothc-0.2.3/native/src/response.rs +251 -0
  45. lothc-0.2.3/native/src/stream.rs +164 -0
  46. lothc-0.2.3/native/src/sync_pool.rs +1473 -0
  47. lothc-0.2.3/native/src/tls.rs +442 -0
  48. lothc-0.2.3/native/src/unsupported.rs +39 -0
  49. {lothc-0.2.2 → lothc-0.2.3}/pyproject.toml +64 -43
  50. lothc-0.2.2/.gitignore +0 -37
  51. lothc-0.2.2/lothc/_client.py +0 -6546
  52. lothc-0.2.2/lothc/testing.py +0 -810
  53. {lothc-0.2.2 → lothc-0.2.3}/LICENSE +0 -0
  54. {lothc-0.2.2 → lothc-0.2.3}/lothc/py.typed +0 -0
@@ -1,29 +1,29 @@
1
- Metadata-Version: 2.5
1
+ Metadata-Version: 2.4
2
2
  Name: lothc
3
- Version: 0.2.2
4
- Summary: Lord Of The Http Clients — a typed HTTP client built on pyreqwest, with first-class pydantic and msgspec support
5
- Project-URL: Homepage, https://github.com/RogerThomas/lothc
6
- Project-URL: Repository, https://github.com/RogerThomas/lothc
7
- Project-URL: Documentation, https://rogerthomas.github.io/lothc/
8
- Project-URL: Issues, https://github.com/RogerThomas/lothc/issues
9
- License-Expression: MIT
10
- License-File: LICENSE
3
+ Version: 0.2.3
11
4
  Classifier: Development Status :: 3 - Alpha
12
5
  Classifier: Intended Audience :: Developers
13
6
  Classifier: Programming Language :: Python :: 3.13
14
7
  Classifier: Programming Language :: Python :: 3.14
15
8
  Classifier: Programming Language :: Python :: 3.15
16
9
  Classifier: Typing :: Typed
17
- Requires-Python: >=3.13
18
10
  Requires-Dist: pyreqwest>=0.13.0
19
11
  Requires-Dist: typing-extensions>=4.13.0
12
+ Requires-Dist: msgspec>=0.19.0 ; extra == 'msgspec'
13
+ Requires-Dist: pydantic>=2.12.5 ; extra == 'pydantic'
14
+ Requires-Dist: pytest>=9.0.2 ; extra == 'testing'
20
15
  Provides-Extra: msgspec
21
- Requires-Dist: msgspec>=0.19.0; extra == 'msgspec'
22
16
  Provides-Extra: pydantic
23
- Requires-Dist: pydantic>=2.12.5; extra == 'pydantic'
24
17
  Provides-Extra: testing
25
- Requires-Dist: pytest>=9.0.2; extra == 'testing'
26
- Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Summary: Lord Of The Http Clients — a typed HTTP client built on pyreqwest, with first-class pydantic and msgspec support
20
+ License-Expression: MIT
21
+ Requires-Python: >=3.13
22
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
+ Project-URL: Documentation, https://rogerthomas.github.io/lothc/
24
+ Project-URL: Homepage, https://github.com/RogerThomas/lothc
25
+ Project-URL: Issues, https://github.com/RogerThomas/lothc/issues
26
+ Project-URL: Repository, https://github.com/RogerThomas/lothc
27
27
 
28
28
  <p align="center">
29
29
  <img src="https://raw.githubusercontent.com/RogerThomas/lothc/main/assets/logo.svg" alt="lothc logo" width="220">
@@ -39,7 +39,7 @@ Description-Content-Type: text/markdown
39
39
  [![License](https://img.shields.io/pypi/l/lothc)](https://github.com/RogerThomas/lothc/blob/main/LICENSE)
40
40
 
41
41
  **L**ord **O**f **T**he **H**ttp **C**lients — a typed HTTP client for Python, built on
42
- [pyreqwest](https://github.com/mostafa-hussein/pyreqwest) (an awesome Rust-backed HTTP client), with
42
+ [pyreqwest](https://github.com/MarkusSintonen/pyreqwest) (an awesome Rust-backed HTTP client), with
43
43
  first-class optional support for **pydantic** and **msgspec** as both decode *and* encode targets.
44
44
 
45
45
  ## Installing
@@ -135,5 +135,6 @@ task check # lint + format-check + typecheck (what CI runs)
135
135
  ## License
136
136
 
137
137
  lothc is [MIT](https://github.com/RogerThomas/lothc/blob/main/LICENSE). It's built on
138
- [pyreqwest](https://github.com/mostafa-hussein/pyreqwest) (Apache-2.0), which is built on the Rust
138
+ [pyreqwest](https://github.com/MarkusSintonen/pyreqwest) (Apache-2.0), which is built on the Rust
139
139
  crate [reqwest](https://github.com/seanmonstar/reqwest) (MIT or Apache-2.0). Thanks to both.
140
+
@@ -12,7 +12,7 @@
12
12
  [![License](https://img.shields.io/pypi/l/lothc)](https://github.com/RogerThomas/lothc/blob/main/LICENSE)
13
13
 
14
14
  **L**ord **O**f **T**he **H**ttp **C**lients — a typed HTTP client for Python, built on
15
- [pyreqwest](https://github.com/mostafa-hussein/pyreqwest) (an awesome Rust-backed HTTP client), with
15
+ [pyreqwest](https://github.com/MarkusSintonen/pyreqwest) (an awesome Rust-backed HTTP client), with
16
16
  first-class optional support for **pydantic** and **msgspec** as both decode *and* encode targets.
17
17
 
18
18
  ## Installing
@@ -108,5 +108,5 @@ task check # lint + format-check + typecheck (what CI runs)
108
108
  ## License
109
109
 
110
110
  lothc is [MIT](https://github.com/RogerThomas/lothc/blob/main/LICENSE). It's built on
111
- [pyreqwest](https://github.com/mostafa-hussein/pyreqwest) (Apache-2.0), which is built on the Rust
111
+ [pyreqwest](https://github.com/MarkusSintonen/pyreqwest) (Apache-2.0), which is built on the Rust
112
112
  crate [reqwest](https://github.com/seanmonstar/reqwest) (MIT or Apache-2.0). Thanks to both.
@@ -1,25 +1,11 @@
1
- from ._client import (
2
- AuthProvider,
3
- CaseInsensitiveDict,
4
- Data,
5
- File,
6
- Form,
7
- Headers,
8
- HTTPClient,
1
+ from ._client import HTTPClient
2
+ from ._errors import (
9
3
  HTTPConnectionError,
10
4
  HTTPResponseError,
11
5
  HTTPTimeoutError,
12
6
  HTTPTransportError,
13
- JSONPayload,
14
- Params,
15
- RequestInfo,
16
- Response,
17
- SSEEvent,
18
- SyncAuthProvider,
19
- SyncHTTPClient,
20
- TlsVersion,
21
- TypedHeaders,
22
7
  )
8
+ from ._headers import CaseInsensitiveDict
23
9
  from ._oauth import (
24
10
  OAuthProvider,
25
11
  OAuthTokenError,
@@ -28,6 +14,24 @@ from ._oauth import (
28
14
  TokenRequestTyping,
29
15
  TokenResponseTyping,
30
16
  )
17
+ from ._response import (
18
+ RequestInfo,
19
+ Response,
20
+ )
21
+ from ._settings import TlsVersion
22
+ from ._sse import SSEEvent
23
+ from ._sync_client import SyncHTTPClient
24
+ from ._types import (
25
+ AuthProvider,
26
+ Data,
27
+ File,
28
+ Form,
29
+ Headers,
30
+ JSONPayload,
31
+ Params,
32
+ SyncAuthProvider,
33
+ TypedHeaders,
34
+ )
31
35
 
32
36
  __all__ = [
33
37
  "AuthProvider",
@@ -57,3 +61,16 @@ __all__ = [
57
61
  "TokenResponseTyping",
58
62
  "TypedHeaders",
59
63
  ]
64
+
65
+
66
+ # Report every public class as `lothc.<Name>`, the path callers import it from, rather than the
67
+ # private module it lives in, so tracebacks and reprs read `lothc.HTTPResponseError` (httpx does
68
+ # the same). Pickle still finds each class, since `lothc` exports it.
69
+ def _report_as_public(namespace: dict[str, object], names: list[str], module: str) -> None:
70
+ for name in names:
71
+ exported = namespace[name]
72
+ if isinstance(exported, type):
73
+ exported.__module__ = module
74
+
75
+
76
+ _report_as_public(globals(), __all__, __name__)