wpr-http 0.2.0__py3-none-any.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.
- wpr_http/__init__.py +60 -0
- wpr_http/__main__.py +28 -0
- wpr_http/_urls.py +31 -0
- wpr_http/client.py +588 -0
- wpr_http/exceptions.py +207 -0
- wpr_http/models.py +331 -0
- wpr_http/transport.py +121 -0
- wpr_http-0.2.0.dist-info/METADATA +52 -0
- wpr_http-0.2.0.dist-info/RECORD +12 -0
- wpr_http-0.2.0.dist-info/WHEEL +5 -0
- wpr_http-0.2.0.dist-info/entry_points.txt +2 -0
- wpr_http-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wpr-http
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Standalone HTTP client using version-selected Firefox Necko/NSS Workers
|
|
5
|
+
License: MPL-2.0-compatible client; see runtime bundle notices
|
|
6
|
+
Project-URL: Repository, https://github.com/childclm/wpr-http
|
|
7
|
+
Project-URL: Documentation, https://github.com/childclm/wpr-http/blob/main/README.md
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: wpr-runtime-core<0.3,>=0.2.0
|
|
11
|
+
|
|
12
|
+
# WPR HTTP
|
|
13
|
+
|
|
14
|
+
Standalone HTTP requests using real, version-selected Firefox Necko/NSS network
|
|
15
|
+
Workers. Installing this package does not install the WPR browser client.
|
|
16
|
+
The native runtime is downloaded separately and remains centrally built.
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
import asyncio
|
|
20
|
+
from wpr_http import AsyncClient
|
|
21
|
+
|
|
22
|
+
async def main():
|
|
23
|
+
async with AsyncClient(firefox_version="155") as client:
|
|
24
|
+
response = await client.get("https://www.baidu.com/")
|
|
25
|
+
async with response:
|
|
26
|
+
response.raise_for_status()
|
|
27
|
+
print(response.status_code, await response.atext())
|
|
28
|
+
|
|
29
|
+
asyncio.run(main())
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`firefox_version` selects a genuine installed Gecko network engine, not a
|
|
33
|
+
User-Agent string or a simulated browser. Only Firefox 155 is currently built
|
|
34
|
+
and supported. Selecting another version raises an explicit compatibility error;
|
|
35
|
+
it never silently uses 155. Different installed engine versions use separate
|
|
36
|
+
runtime/profile locations and separate Worker processes.
|
|
37
|
+
|
|
38
|
+
Runtime installation and supported versions:
|
|
39
|
+
|
|
40
|
+
```powershell
|
|
41
|
+
python -m wpr_http runtimes
|
|
42
|
+
python -m wpr_http install-runtime --version 155
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
An explicit `runtime_home` can select another verified runtime installation.
|
|
46
|
+
Existing `AsyncWprHttpClient`, Request/Response/Timeout and exception names remain
|
|
47
|
+
available. `WprHttpClient` remains the historical asynchronous alias.
|
|
48
|
+
|
|
49
|
+
The native network runtime is a separate download from the private
|
|
50
|
+
`childclm/gecko-web-runtime` Release. Installation needs access to that repository. Set
|
|
51
|
+
`WPR_GITHUB_TOKEN` or `GH_TOKEN`, or use Git Credential Manager, then run
|
|
52
|
+
`python -m wpr_http install-runtime --version 155`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
wpr_http/__init__.py,sha256=zv148B6FowlAg-HX8jtzVUe41y59wY-OjX8d1m86OXw,1625
|
|
2
|
+
wpr_http/__main__.py,sha256=Xy09DqttkiyPqPDCjxdmQy1qF3xDO9RL-g0KwRNuqVA,939
|
|
3
|
+
wpr_http/_urls.py,sha256=rxZThfZUNOkm8OU4GGWNiDBDGhgzNA4gKVOpEcQWSpw,971
|
|
4
|
+
wpr_http/client.py,sha256=u203-NhMyenFcwyxXOABjCEWqYMILVLTFTwIIgV6DFE,24010
|
|
5
|
+
wpr_http/exceptions.py,sha256=YpgFvt_c38ZXjnvH98uFZD15iKkMxz2BCJtXZJ49czc,7027
|
|
6
|
+
wpr_http/models.py,sha256=J7mHmRjNRUK1mu4VAVnMfEAA1jmZbBVzGVUVxFpeors,11350
|
|
7
|
+
wpr_http/transport.py,sha256=SDTdypES85vg3oaCj7hUgPQXIvhmV8et_rnpnhTjCxQ,4427
|
|
8
|
+
wpr_http-0.2.0.dist-info/METADATA,sha256=Ssvsujy_Dvn4s8OIXxjX0Zq_SX8rbDBr6VpaENOG8Co,2125
|
|
9
|
+
wpr_http-0.2.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
10
|
+
wpr_http-0.2.0.dist-info/entry_points.txt,sha256=yHFXvrUpusqUl7KXebNdUtJiq0RVJqL0nLt553Si9m0,52
|
|
11
|
+
wpr_http-0.2.0.dist-info/top_level.txt,sha256=aXpxdjgwYtW0awKawVpqBFfyK78g2Jko0SA5_j4MGUQ,9
|
|
12
|
+
wpr_http-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
wpr_http
|