rnet 3.0.0rc1__cp311-abi3-macosx_11_0_arm64.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 rnet might be problematic. Click here for more details.
- rnet/__init__.py +19 -0
- rnet/__init__.pyi +1174 -0
- rnet/blocking.py +511 -0
- rnet/cookie.py +130 -0
- rnet/emulation.py +185 -0
- rnet/exceptions.py +214 -0
- rnet/header.py +431 -0
- rnet/py.typed +0 -0
- rnet/rnet.abi3.so +0 -0
- rnet/tls.py +161 -0
- rnet-3.0.0rc1.dist-info/METADATA +188 -0
- rnet-3.0.0rc1.dist-info/RECORD +14 -0
- rnet-3.0.0rc1.dist-info/WHEEL +4 -0
- rnet-3.0.0rc1.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rnet
|
|
3
|
+
Version: 3.0.0rc1
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Operating System :: POSIX
|
|
16
|
+
Classifier: Operating System :: Unix
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Summary: A blazing-fast Python HTTP client with TLS fingerprint
|
|
20
|
+
Keywords: http,client,websocket,ja3,ja4
|
|
21
|
+
Author-email: 0x676e67 <gngppz@gmail.com>
|
|
22
|
+
License: GPL-3.0
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
25
|
+
Project-URL: Documentation, https://github.com/0x676e67/rnet/blob/main/rnet.pyi
|
|
26
|
+
Project-URL: Homepage, https://github.com/0x676e67/rnet
|
|
27
|
+
Project-URL: Repository, https://github.com/0x676e67/rnet
|
|
28
|
+
|
|
29
|
+
# rnet
|
|
30
|
+
|
|
31
|
+
[](https://github.com/0x676e67/rnet/actions/workflows/ci.yml)
|
|
32
|
+
[](https://github.com/0x676e67/rnet/blob/main/LICENSE)
|
|
33
|
+

|
|
34
|
+
[](https://pypi.org/project/rnet/)
|
|
35
|
+
[](https://pepy.tech/projects/rnet)
|
|
36
|
+
|
|
37
|
+
> 🚀 Help me work seamlessly with open source sharing by [sponsoring me on GitHub](https://github.com/0x676e67/0x676e67/blob/main/SPONSOR.md)
|
|
38
|
+
|
|
39
|
+
A blazing-fast Python HTTP client with advanced browser fingerprinting that accurately emulates **Chrome**, **Firefox**, **Safari**, **Opera**, and **OkHttp**, with precise **TLS/HTTP2** signatures, and powered by [wreq](https://github.com/0x676e67/wreq) for high performance.
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- Async and Blocking `Client`s
|
|
44
|
+
- Plain bodies, JSON, urlencoded, multipart
|
|
45
|
+
- Cookie Store
|
|
46
|
+
- Redirect Policy
|
|
47
|
+
- Original Header
|
|
48
|
+
- Rotating Proxies
|
|
49
|
+
- Connection Pooling
|
|
50
|
+
- Streaming Transfers
|
|
51
|
+
- Zero-Copy Transfers
|
|
52
|
+
- WebSocket Upgrade
|
|
53
|
+
- Async DNS Resolver
|
|
54
|
+
- HTTPS via BoringSSL
|
|
55
|
+
- Free-Threaded Safety
|
|
56
|
+
- Automatic Decompression
|
|
57
|
+
|
|
58
|
+
## Example
|
|
59
|
+
|
|
60
|
+
This asynchronous example demonstrates how to make a simple GET request using the `rnet` library. So you need install `rnet` and run the following code:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install asyncio rnet==3.0.0rc1
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
And then the code:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
import asyncio
|
|
70
|
+
from rnet import Emulation, Client
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
async def main():
|
|
74
|
+
# Build a client
|
|
75
|
+
client = Client(emulation=Emulation.Firefox139)
|
|
76
|
+
|
|
77
|
+
# Use the API you're already familiar with
|
|
78
|
+
resp = await client.get("https://tls.peet.ws/api/all")
|
|
79
|
+
|
|
80
|
+
# Print the response
|
|
81
|
+
print(await resp.text())
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
if __name__ == "__main__":
|
|
85
|
+
asyncio.run(main())
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Additional learning resources include:
|
|
90
|
+
|
|
91
|
+
- [DeepWiki](https://deepwiki.com/0x676e67/rnet)
|
|
92
|
+
- [API Documentation](https://github.com/0x676e67/rnet/blob/main/python/rnet)
|
|
93
|
+
- [Repository Tests](https://github.com/0x676e67/rnet/tree/main/tests)
|
|
94
|
+
- [Repository Examples](https://github.com/0x676e67/rnet/tree/main/python/examples)
|
|
95
|
+
|
|
96
|
+
## Platforms
|
|
97
|
+
|
|
98
|
+
1. Linux
|
|
99
|
+
|
|
100
|
+
- **glibc >= 2.34**: `x86_64`, `aarch64`, `armv7`, `i686`
|
|
101
|
+
- **musl**: `x86_64`, `aarch64`, `armv7`, `i686`
|
|
102
|
+
|
|
103
|
+
2. macOS: `x86_64`,`aarch64`
|
|
104
|
+
|
|
105
|
+
3. Windows: `x86_64`,`i686`,`aarch64`
|
|
106
|
+
|
|
107
|
+
## Building
|
|
108
|
+
|
|
109
|
+
1. Install environment
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
113
|
+
pip install maturin
|
|
114
|
+
pip install uv
|
|
115
|
+
|
|
116
|
+
uv venv
|
|
117
|
+
source .venv/bin/activate
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
2. Development
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# build and install the package
|
|
124
|
+
maturin develop --uv
|
|
125
|
+
python3 examples/client.py
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
3. Compile wheels
|
|
129
|
+
|
|
130
|
+
Install the BoringSSL build environment by referring to [boring](https://github.com/cloudflare/boring/blob/master/.github/workflows/ci.yml) and [boringssl](https://github.com/google/boringssl/blob/master/BUILDING.md#build-prerequisites).
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# on ubuntu or debian
|
|
134
|
+
sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools git -y
|
|
135
|
+
maturin build --release
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
- Musllinux
|
|
139
|
+
|
|
140
|
+
Make sure you have Docker installed. The provided image may be outdated, so you might need to build it yourself. See [rust-cross-musl](https://github.com/0x676e67/toolchain/blob/master/rust-musl-cross/Dockerfile) and the upstream [rust-cross/rust-musl-cross](https://github.com/rust-cross/rust-musl-cross) for reference.
|
|
141
|
+
**Note:** The upstream image does not include some platform-specific linker environment variables; you may need to add these manually.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
bash .github/musl_build.sh x86_64-unknown-linux-musl
|
|
145
|
+
bash .github/musl_build.sh aarch64-unknown-linux-musl
|
|
146
|
+
bash .github/musl_build.sh armv7-unknown-linux-musleabihf
|
|
147
|
+
bash .github/musl_build.sh i686-unknown-linux-musl
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
- Manylinux
|
|
151
|
+
|
|
152
|
+
For Manylinux compilation, refer to [manylinux](https://github.com/PyO3/maturin?tab=readme-ov-file#manylinux-and-auditwheel).
|
|
153
|
+
|
|
154
|
+
## Benchmark
|
|
155
|
+
|
|
156
|
+
Outperforms `requests`, `httpx`, `Python-TLS-Client`, and `curl_cffi`. See the [benchmark](https://github.com/0x676e67/rnet/tree/main/python/benchmark) for details. Benchmark data is for reference only—actual performance may vary based on your environment and use case.
|
|
157
|
+
|
|
158
|
+
## Documentation
|
|
159
|
+
|
|
160
|
+
For a comprehensive introduction to this library, refer to the [DeepWiki](https://deepwiki.com/0x676e67/rnet) documentation. This AI-generated guide, created by a third party, offers a solid overview and allows interaction with the AI to explore specific APIs.
|
|
161
|
+
|
|
162
|
+
## Emulation
|
|
163
|
+
|
|
164
|
+
In fact, most device models share the same `TLS`/`HTTP2` configuration, with the main difference being the `User-Agent`.
|
|
165
|
+
|
|
166
|
+
| **Browser** | **Versions** |
|
|
167
|
+
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
168
|
+
| **Chrome** | `Chrome100`, `Chrome101`, `Chrome104`, `Chrome105`, `Chrome106`, `Chrome107`, `Chrome108`, `Chrome109`, `Chrome110`, `Chrome114`, `Chrome116`, `Chrome117`, `Chrome118`, `Chrome119`, `Chrome120`, `Chrome123`, `Chrome124`, `Chrome126`, `Chrome127`, `Chrome128`, `Chrome129`, `Chrome130`, `Chrome131`, `Chrome132`, `Chrome133`, `Chrome134`, `Chrome135`, `Chrome136`, `Chrome137` |
|
|
169
|
+
| **Safari** | `SafariIos17_2`, `SafariIos17_4_1`, `SafariIos16_5`, `Safari15_3`, `Safari15_5`, `Safari15_6_1`, `Safari16`, `Safari16_5`, `Safari17_0`, `Safari17_2_1`, `Safari17_4_1`, `Safari17_5`, `Safari18`, `SafariIPad18`, `Safari18_2`, `SafariIos18_1_1`, `Safari18_3`, `Safari18_3_1`, `Safari18_5` |
|
|
170
|
+
| **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139` |
|
|
171
|
+
| **OkHttp** | `OkHttp3_9`, `OkHttp3_11`, `OkHttp3_13`, `OkHttp3_14`, `OkHttp4_9`, `OkHttp4_10`, `OkHttp4_12`, `OkHttp5` |
|
|
172
|
+
| **Edge** | `Edge101`, `Edge122`, `Edge127`, `Edge131`, `Edge134` |
|
|
173
|
+
| **Opera** | `Opera116`, `Opera117`, `Opera118`, `Opera119` |
|
|
174
|
+
|
|
175
|
+
## Contributing
|
|
176
|
+
|
|
177
|
+
If you would like to submit your contribution, please open a [Pull Request](https://github.com/0x676e67/rnet/pulls).
|
|
178
|
+
|
|
179
|
+
## Sponsors
|
|
180
|
+
|
|
181
|
+
<a href="https://dashboard.capsolver.com/passport/register?inviteCode=y7CtB_a-3X6d" target="_blank"><img src="https://raw.githubusercontent.com/0x676e67/rnet/main/.github/assets/capsolver.jpg" height="47" width="149"></a>
|
|
182
|
+
|
|
183
|
+
[CapSolver](https://www.capsolver.com/?utm_source=github&utm_medium=banner_repo&utm_campaign=rnet) leverages AI-powered Auto Web Unblock to bypass Captchas effortlessly, providing fast, reliable, and cost-effective data access with seamless integration into Colly, Puppeteer, and Playwright—use code **`RNET`** for a 6% bonus!
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
**rnet** © [0x676e67](https://github.com/0x676e67), Released under the [GPL-3.0](https://github.com/0x676e67/rnet/blob/main/LICENSE) License.
|
|
188
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
rnet-3.0.0rc1.dist-info/METADATA,sha256=I7WMxAsKWF5uU6WfLht1LeD4N-mMvAc3XGQ6p-FvDkw,10047
|
|
2
|
+
rnet-3.0.0rc1.dist-info/WHEEL,sha256=6FsaH53F12OzO11ZB57hTDesKbBIcqCM7w19loA4k_Q,103
|
|
3
|
+
rnet-3.0.0rc1.dist-info/licenses/LICENSE,sha256=ryRV02Zq6zAIr1heqDUkcGlpP7gVCDF6AqR4wRa82kI,35153
|
|
4
|
+
rnet/__init__.py,sha256=gqet5qGPHqS1VRr8XjzpQOuYetNn-aLss4lTR7cZ_9M,317
|
|
5
|
+
rnet/__init__.pyi,sha256=g74_wT2p_7-TGKTYr5xSoDCxFkn34OU1Glz4UzTnGW8,29521
|
|
6
|
+
rnet/blocking.py,sha256=Xo8CwyuhyEd-k6D88nbTIB1aLb-wUbDZNy2-AaXcdrw,13536
|
|
7
|
+
rnet/cookie.py,sha256=fN8V-OKr-LT3psv9XTvHfnPD8Nwp10Awxxg762ScwP0,2877
|
|
8
|
+
rnet/emulation.py,sha256=i3Qv1-c0wtWgxJ_hOlS6AFjNDIO4GsSP2SvRONRS6FI,5029
|
|
9
|
+
rnet/exceptions.py,sha256=pr8RNPhr_CswkdKgZGvamSFwyrHE6OPQk72YcJACNBo,5906
|
|
10
|
+
rnet/header.py,sha256=xbBb0wWKZRUs2ylldU_sN13QYBUDvZ-3zynCBd4UiYs,12955
|
|
11
|
+
rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
rnet/rnet.abi3.so,sha256=Ade9nQvMYmOskL5i_8aWEQmeg5uZ_t4_ux6LofgjfiA,7410816
|
|
13
|
+
rnet/tls.py,sha256=Ko0h58k3twVyycuqK7zgBtN3JLnhZ8oDUZqANJshEDE,4811
|
|
14
|
+
rnet-3.0.0rc1.dist-info/RECORD,,
|