pyinproxy 0.1.1__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.
Potentially problematic release.
This version of pyinproxy might be problematic. Click here for more details.
- pyinproxy-0.1.1/LICENSE +19 -0
- pyinproxy-0.1.1/MANIFEST.in +1 -0
- pyinproxy-0.1.1/PKG-INFO +254 -0
- pyinproxy-0.1.1/README.md +205 -0
- pyinproxy-0.1.1/inproxy/__init__.py +5 -0
- pyinproxy-0.1.1/inproxy/config.py +1029 -0
- pyinproxy-0.1.1/inproxy/exceptions.py +6 -0
- pyinproxy-0.1.1/inproxy/main.py +1406 -0
- pyinproxy-0.1.1/pyinproxy.egg-info/PKG-INFO +254 -0
- pyinproxy-0.1.1/pyinproxy.egg-info/SOURCES.txt +19 -0
- pyinproxy-0.1.1/pyinproxy.egg-info/dependency_links.txt +1 -0
- pyinproxy-0.1.1/pyinproxy.egg-info/requires.txt +7 -0
- pyinproxy-0.1.1/pyinproxy.egg-info/top_level.txt +1 -0
- pyinproxy-0.1.1/pyinproxy.egg-info/zip-safe +1 -0
- pyinproxy-0.1.1/requirements.txt +7 -0
- pyinproxy-0.1.1/setup.cfg +4 -0
- pyinproxy-0.1.1/setup.py +76 -0
pyinproxy-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2026 Pranav Agrawal
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include requirements.txt
|
pyinproxy-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyinproxy
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Home-page: https://github.com/pranavagrawal321/inproxy
|
|
5
|
+
Author: Pranav Agrawal
|
|
6
|
+
Author-email: pranavagrawal321@gmail.com
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Source, https://github.com/pranavagrawal321/inproxy
|
|
9
|
+
Project-URL: Issues, https://github.com/pranavagrawal321/inproxy/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/pranavagrawal321/inproxy#readme
|
|
11
|
+
Keywords: user agent,app detection,device detection,client hints
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: curl_cffi
|
|
30
|
+
Requires-Dist: requests[socks]
|
|
31
|
+
Requires-Dist: lxml
|
|
32
|
+
Requires-Dist: pandas
|
|
33
|
+
Requires-Dist: fake_useragent
|
|
34
|
+
Requires-Dist: html5lib
|
|
35
|
+
Requires-Dist: bs4
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: author-email
|
|
38
|
+
Dynamic: classifier
|
|
39
|
+
Dynamic: description
|
|
40
|
+
Dynamic: description-content-type
|
|
41
|
+
Dynamic: home-page
|
|
42
|
+
Dynamic: keywords
|
|
43
|
+
Dynamic: license
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: project-url
|
|
46
|
+
Dynamic: requires-dist
|
|
47
|
+
Dynamic: requires-python
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# inproxy
|
|
51
|
+
|
|
52
|
+
A Python library to fetch free public proxies from multiple online sources, with support for filtering, concurrent fetching, and structured proxy data.
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install inproxy
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from inproxy import InProxy
|
|
64
|
+
|
|
65
|
+
proxy = InProxy()
|
|
66
|
+
|
|
67
|
+
proxies = proxy.fetch(count=10)
|
|
68
|
+
|
|
69
|
+
for item in proxies:
|
|
70
|
+
print(item.proxy)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Filtering Proxies
|
|
74
|
+
|
|
75
|
+
You can filter proxies using location, network, anonymity, and latency attributes.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from inproxy import InProxy
|
|
79
|
+
|
|
80
|
+
proxy = InProxy()
|
|
81
|
+
|
|
82
|
+
proxies = proxy.fetch(
|
|
83
|
+
count=10,
|
|
84
|
+
country="India",
|
|
85
|
+
country_code="IN",
|
|
86
|
+
anonymity="elite",
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
for item in proxies:
|
|
90
|
+
print(item.proxy)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Available filters:
|
|
94
|
+
|
|
95
|
+
| Parameter | Description |
|
|
96
|
+
|---|---|
|
|
97
|
+
| `count` | Number of proxies to fetch |
|
|
98
|
+
| `sites` | Specific proxy sources to use |
|
|
99
|
+
| `country` | Filter by country |
|
|
100
|
+
| `country_code` | Filter by country code |
|
|
101
|
+
| `state` | Filter by state |
|
|
102
|
+
| `state_code` | Filter by state code |
|
|
103
|
+
| `city` | Filter by city |
|
|
104
|
+
| `region` | Filter by region |
|
|
105
|
+
| `continent` | Filter by continent |
|
|
106
|
+
| `timezone` | Filter by timezone |
|
|
107
|
+
| `isp` | Filter by ISP |
|
|
108
|
+
| `organization` | Filter by organization |
|
|
109
|
+
| `asn` | Filter by ASN |
|
|
110
|
+
| `anonymity` | Filter by anonymity level |
|
|
111
|
+
| `min_latency` | Minimum latency |
|
|
112
|
+
| `max_latency` | Maximum latency |
|
|
113
|
+
|
|
114
|
+
Note: Filtering depends on the metadata provided by each proxy source. Sources that do not provide a particular field cannot satisfy a filter on that field.
|
|
115
|
+
|
|
116
|
+
## Selecting Proxy Sources
|
|
117
|
+
|
|
118
|
+
By default, `inproxy` uses all configured sources.
|
|
119
|
+
|
|
120
|
+
You can specify individual sources using their names:
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from inproxy import InProxy
|
|
124
|
+
|
|
125
|
+
proxy = InProxy()
|
|
126
|
+
|
|
127
|
+
proxies = proxy.fetch(
|
|
128
|
+
count=20,
|
|
129
|
+
sites=["proxyscrape", "geonode", "iproyal"],
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
for item in proxies:
|
|
133
|
+
print(item.proxy)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
You can also provide multiple source names as a comma-separated string:
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
proxies = proxy.fetch(
|
|
140
|
+
count=20,
|
|
141
|
+
sites="proxyscrape,geonode,iproyal",
|
|
142
|
+
)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Working with Proxy Objects
|
|
146
|
+
|
|
147
|
+
Each result is a structured `Proxy` object.
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
from inproxy import InProxy
|
|
151
|
+
|
|
152
|
+
proxy = InProxy()
|
|
153
|
+
proxies = proxy.fetch(count=5)
|
|
154
|
+
|
|
155
|
+
for item in proxies:
|
|
156
|
+
print("Proxy:", item.proxy)
|
|
157
|
+
print("IP:", item.ip)
|
|
158
|
+
print("Port:", item.port)
|
|
159
|
+
print("Protocol:", item.protocol)
|
|
160
|
+
print("Country:", item.country)
|
|
161
|
+
print("Country Code:", item.country_code)
|
|
162
|
+
print("Anonymity:", item.anonymity)
|
|
163
|
+
print("Latency:", item.latency)
|
|
164
|
+
print()
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Proxy URL
|
|
168
|
+
|
|
169
|
+
The `.proxy` property returns the proxy in URL format:
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
http://192.168.1.10:8080
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
The protocol and port are taken from the proxy data.
|
|
176
|
+
|
|
177
|
+
### Convert to Dictionary
|
|
178
|
+
|
|
179
|
+
Use `to_dict()` to convert a proxy object into a dictionary:
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
proxies = proxy.fetch(count=5)
|
|
183
|
+
|
|
184
|
+
proxy_data = [item.to_dict() for item in proxies]
|
|
185
|
+
|
|
186
|
+
print(proxy_data)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Each dictionary includes the proxy fields and the formatted `proxy` URL.
|
|
190
|
+
|
|
191
|
+
## Using Proxies with Requests
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
import requests
|
|
195
|
+
from inproxy import InProxy
|
|
196
|
+
|
|
197
|
+
proxy = InProxy()
|
|
198
|
+
proxies = proxy.fetch(count=1)
|
|
199
|
+
|
|
200
|
+
if proxies:
|
|
201
|
+
proxy_url = proxies[0].proxy
|
|
202
|
+
|
|
203
|
+
response = requests.get(
|
|
204
|
+
"https://httpbin.org/ip",
|
|
205
|
+
proxies={
|
|
206
|
+
"http": proxy_url,
|
|
207
|
+
"https": proxy_url,
|
|
208
|
+
},
|
|
209
|
+
timeout=15,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
print(response.text)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Configuration
|
|
216
|
+
|
|
217
|
+
You can configure the number of concurrent source workers and the timeout used for source requests:
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
from inproxy import InProxy
|
|
221
|
+
|
|
222
|
+
proxy = InProxy(
|
|
223
|
+
source_workers=20,
|
|
224
|
+
source_timeout=5,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
proxies = proxy.fetch(count=10)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
| Parameter | Default | Description |
|
|
231
|
+
|---|---:|---|
|
|
232
|
+
| `source_workers` | `20` | Maximum number of concurrent source workers |
|
|
233
|
+
| `source_timeout` | `3` | Timeout in seconds for source requests |
|
|
234
|
+
|
|
235
|
+
## Important Notes
|
|
236
|
+
|
|
237
|
+
- Proxies are collected from public third-party sources.
|
|
238
|
+
- Proxy availability and response times can change at any moment.
|
|
239
|
+
- Not every source provides complete proxy metadata.
|
|
240
|
+
- A requested number of proxies is a target, not a guarantee. The returned list may contain fewer results.
|
|
241
|
+
- Public proxies are unreliable and should not be used for sensitive information or credentials.
|
|
242
|
+
|
|
243
|
+
## Requirements
|
|
244
|
+
|
|
245
|
+
- Python 3.10 or higher
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
This project is licensed under the MIT License.
|
|
250
|
+
|
|
251
|
+
## Links
|
|
252
|
+
|
|
253
|
+
- [GitHub Repository](https://github.com/pranavagrawal321/inproxy)
|
|
254
|
+
- [Report an Issue](https://github.com/pranavagrawal321/inproxy/issues)
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# inproxy
|
|
2
|
+
|
|
3
|
+
A Python library to fetch free public proxies from multiple online sources, with support for filtering, concurrent fetching, and structured proxy data.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install inproxy
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from inproxy import InProxy
|
|
15
|
+
|
|
16
|
+
proxy = InProxy()
|
|
17
|
+
|
|
18
|
+
proxies = proxy.fetch(count=10)
|
|
19
|
+
|
|
20
|
+
for item in proxies:
|
|
21
|
+
print(item.proxy)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Filtering Proxies
|
|
25
|
+
|
|
26
|
+
You can filter proxies using location, network, anonymity, and latency attributes.
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from inproxy import InProxy
|
|
30
|
+
|
|
31
|
+
proxy = InProxy()
|
|
32
|
+
|
|
33
|
+
proxies = proxy.fetch(
|
|
34
|
+
count=10,
|
|
35
|
+
country="India",
|
|
36
|
+
country_code="IN",
|
|
37
|
+
anonymity="elite",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
for item in proxies:
|
|
41
|
+
print(item.proxy)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Available filters:
|
|
45
|
+
|
|
46
|
+
| Parameter | Description |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `count` | Number of proxies to fetch |
|
|
49
|
+
| `sites` | Specific proxy sources to use |
|
|
50
|
+
| `country` | Filter by country |
|
|
51
|
+
| `country_code` | Filter by country code |
|
|
52
|
+
| `state` | Filter by state |
|
|
53
|
+
| `state_code` | Filter by state code |
|
|
54
|
+
| `city` | Filter by city |
|
|
55
|
+
| `region` | Filter by region |
|
|
56
|
+
| `continent` | Filter by continent |
|
|
57
|
+
| `timezone` | Filter by timezone |
|
|
58
|
+
| `isp` | Filter by ISP |
|
|
59
|
+
| `organization` | Filter by organization |
|
|
60
|
+
| `asn` | Filter by ASN |
|
|
61
|
+
| `anonymity` | Filter by anonymity level |
|
|
62
|
+
| `min_latency` | Minimum latency |
|
|
63
|
+
| `max_latency` | Maximum latency |
|
|
64
|
+
|
|
65
|
+
Note: Filtering depends on the metadata provided by each proxy source. Sources that do not provide a particular field cannot satisfy a filter on that field.
|
|
66
|
+
|
|
67
|
+
## Selecting Proxy Sources
|
|
68
|
+
|
|
69
|
+
By default, `inproxy` uses all configured sources.
|
|
70
|
+
|
|
71
|
+
You can specify individual sources using their names:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from inproxy import InProxy
|
|
75
|
+
|
|
76
|
+
proxy = InProxy()
|
|
77
|
+
|
|
78
|
+
proxies = proxy.fetch(
|
|
79
|
+
count=20,
|
|
80
|
+
sites=["proxyscrape", "geonode", "iproyal"],
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
for item in proxies:
|
|
84
|
+
print(item.proxy)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
You can also provide multiple source names as a comma-separated string:
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
proxies = proxy.fetch(
|
|
91
|
+
count=20,
|
|
92
|
+
sites="proxyscrape,geonode,iproyal",
|
|
93
|
+
)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Working with Proxy Objects
|
|
97
|
+
|
|
98
|
+
Each result is a structured `Proxy` object.
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from inproxy import InProxy
|
|
102
|
+
|
|
103
|
+
proxy = InProxy()
|
|
104
|
+
proxies = proxy.fetch(count=5)
|
|
105
|
+
|
|
106
|
+
for item in proxies:
|
|
107
|
+
print("Proxy:", item.proxy)
|
|
108
|
+
print("IP:", item.ip)
|
|
109
|
+
print("Port:", item.port)
|
|
110
|
+
print("Protocol:", item.protocol)
|
|
111
|
+
print("Country:", item.country)
|
|
112
|
+
print("Country Code:", item.country_code)
|
|
113
|
+
print("Anonymity:", item.anonymity)
|
|
114
|
+
print("Latency:", item.latency)
|
|
115
|
+
print()
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Proxy URL
|
|
119
|
+
|
|
120
|
+
The `.proxy` property returns the proxy in URL format:
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
http://192.168.1.10:8080
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The protocol and port are taken from the proxy data.
|
|
127
|
+
|
|
128
|
+
### Convert to Dictionary
|
|
129
|
+
|
|
130
|
+
Use `to_dict()` to convert a proxy object into a dictionary:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
proxies = proxy.fetch(count=5)
|
|
134
|
+
|
|
135
|
+
proxy_data = [item.to_dict() for item in proxies]
|
|
136
|
+
|
|
137
|
+
print(proxy_data)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Each dictionary includes the proxy fields and the formatted `proxy` URL.
|
|
141
|
+
|
|
142
|
+
## Using Proxies with Requests
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
import requests
|
|
146
|
+
from inproxy import InProxy
|
|
147
|
+
|
|
148
|
+
proxy = InProxy()
|
|
149
|
+
proxies = proxy.fetch(count=1)
|
|
150
|
+
|
|
151
|
+
if proxies:
|
|
152
|
+
proxy_url = proxies[0].proxy
|
|
153
|
+
|
|
154
|
+
response = requests.get(
|
|
155
|
+
"https://httpbin.org/ip",
|
|
156
|
+
proxies={
|
|
157
|
+
"http": proxy_url,
|
|
158
|
+
"https": proxy_url,
|
|
159
|
+
},
|
|
160
|
+
timeout=15,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
print(response.text)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Configuration
|
|
167
|
+
|
|
168
|
+
You can configure the number of concurrent source workers and the timeout used for source requests:
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
from inproxy import InProxy
|
|
172
|
+
|
|
173
|
+
proxy = InProxy(
|
|
174
|
+
source_workers=20,
|
|
175
|
+
source_timeout=5,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
proxies = proxy.fetch(count=10)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
| Parameter | Default | Description |
|
|
182
|
+
|---|---:|---|
|
|
183
|
+
| `source_workers` | `20` | Maximum number of concurrent source workers |
|
|
184
|
+
| `source_timeout` | `3` | Timeout in seconds for source requests |
|
|
185
|
+
|
|
186
|
+
## Important Notes
|
|
187
|
+
|
|
188
|
+
- Proxies are collected from public third-party sources.
|
|
189
|
+
- Proxy availability and response times can change at any moment.
|
|
190
|
+
- Not every source provides complete proxy metadata.
|
|
191
|
+
- A requested number of proxies is a target, not a guarantee. The returned list may contain fewer results.
|
|
192
|
+
- Public proxies are unreliable and should not be used for sensitive information or credentials.
|
|
193
|
+
|
|
194
|
+
## Requirements
|
|
195
|
+
|
|
196
|
+
- Python 3.10 or higher
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
This project is licensed under the MIT License.
|
|
201
|
+
|
|
202
|
+
## Links
|
|
203
|
+
|
|
204
|
+
- [GitHub Repository](https://github.com/pranavagrawal321/inproxy)
|
|
205
|
+
- [Report an Issue](https://github.com/pranavagrawal321/inproxy/issues)
|