ipspot 0.3__tar.gz → 0.5__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.
- {ipspot-0.3 → ipspot-0.5}/AUTHORS.md +2 -0
- ipspot-0.5/CHANGELOG.md +94 -0
- {ipspot-0.3 → ipspot-0.5}/PKG-INFO +167 -30
- {ipspot-0.3 → ipspot-0.5}/README.md +119 -26
- {ipspot-0.3 → ipspot-0.5}/SECURITY.md +2 -2
- {ipspot-0.3 → ipspot-0.5}/dev-requirements.txt +1 -1
- {ipspot-0.3 → ipspot-0.5}/ipspot/__init__.py +2 -1
- ipspot-0.5/ipspot/cli.py +128 -0
- ipspot-0.5/ipspot/ipv4.py +643 -0
- ipspot-0.5/ipspot/ipv6.py +245 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot/params.py +29 -6
- ipspot-0.5/ipspot/utils.py +69 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot.egg-info/PKG-INFO +167 -30
- {ipspot-0.3 → ipspot-0.5}/ipspot.egg-info/SOURCES.txt +5 -1
- {ipspot-0.3 → ipspot-0.5}/setup.py +3 -3
- ipspot-0.5/tests/test_ipv4_api.py +139 -0
- ipspot-0.5/tests/test_ipv4_functions.py +336 -0
- ipspot-0.5/tests/test_ipv6_api.py +58 -0
- ipspot-0.5/tests/test_ipv6_functions.py +61 -0
- ipspot-0.5/tests/test_utils.py +67 -0
- ipspot-0.3/CHANGELOG.md +0 -50
- ipspot-0.3/ipspot/cli.py +0 -73
- ipspot-0.3/ipspot/ipv4.py +0 -273
- ipspot-0.3/ipspot/utils.py +0 -30
- ipspot-0.3/tests/test_ipv4.py +0 -202
- ipspot-0.3/tests/test_utils.py +0 -24
- {ipspot-0.3 → ipspot-0.5}/LICENSE +0 -0
- {ipspot-0.3 → ipspot-0.5}/MANIFEST.in +0 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot/__main__.py +0 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot.egg-info/dependency_links.txt +0 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot.egg-info/entry_points.txt +0 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot.egg-info/requires.txt +0 -0
- {ipspot-0.3 → ipspot-0.5}/ipspot.egg-info/top_level.txt +0 -0
- {ipspot-0.3 → ipspot-0.5}/requirements.txt +0 -0
- {ipspot-0.3 → ipspot-0.5}/setup.cfg +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Core Developers
|
|
2
2
|
----------
|
|
3
3
|
- Sepand Haghighi - Open Science Laboratory ([Github](https://github.com/sepandhaghighi)) **
|
|
4
|
+
- Sadra Sabouri - Open Science Laboratory ([Github](https://github.com/sadrasabouri))
|
|
5
|
+
- AmirHosein Rostami - Open Science Laboratory ([Github](https://github.com/AHReccese))
|
|
4
6
|
|
|
5
7
|
** **Maintainer**
|
|
6
8
|
|
ipspot-0.5/CHANGELOG.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
## [0.5] - 2025-10-17
|
|
9
|
+
### Added
|
|
10
|
+
- `setup-warp` action
|
|
11
|
+
- Support [ipwho.is](https://ipwho.is/)
|
|
12
|
+
- Support [ipquery.io](http://api.ipquery.io/?format=json)
|
|
13
|
+
- Support [wtfismyip.com](https://wtfismyip.com/json)
|
|
14
|
+
- Support [ident.me](https://ident.me/json) IPv6 API
|
|
15
|
+
- Support [tnedi.me](https://tnedi.me/json) IPv6 API
|
|
16
|
+
- Support [ip.sb](https://api.ip.sb/geoip) IPv6 API
|
|
17
|
+
- Support [ipleak.net](https://ipleak.net/json/) IPv6 API
|
|
18
|
+
- Support [my-ip.io](https://www.my-ip.io/) IPv6 API
|
|
19
|
+
- `is_ipv6` function
|
|
20
|
+
- `get_private_ipv6` function
|
|
21
|
+
- `get_public_ipv6` function
|
|
22
|
+
- `IPv6API` enum
|
|
23
|
+
- `--ipv6-api` argument
|
|
24
|
+
### Changed
|
|
25
|
+
- Test system modified
|
|
26
|
+
- `README.md` updated
|
|
27
|
+
## [0.4] - 2025-06-09
|
|
28
|
+
### Added
|
|
29
|
+
- Support [ipapi.co](https://ipapi.co/json/)
|
|
30
|
+
- Support [ipleak.net](https://ipleak.net/json/)
|
|
31
|
+
- Support [my-ip.io](https://www.my-ip.io/)
|
|
32
|
+
- Support [ifconfig.co](https://ifconfig.co/json)
|
|
33
|
+
- Support [reallyfreegeoip.org](https://reallyfreegeoip.org/json/)
|
|
34
|
+
- Support [myip.la](https://api.myip.la/en?json)
|
|
35
|
+
- Support [freeipapi.com](https://freeipapi.com/api/json/)
|
|
36
|
+
- `AUTO_SAFE` mode
|
|
37
|
+
- `_get_json_standard` function
|
|
38
|
+
- `_get_json_ipv4_forced` function
|
|
39
|
+
- `--max-retries` argument
|
|
40
|
+
- `--retry-delay` argument
|
|
41
|
+
### Changed
|
|
42
|
+
- `IPv4API.IPAPI` renamed to `IPv4API.IP_API_COM`
|
|
43
|
+
- `IPv4API.IPINFO` renamed to `IPv4API.IPINFO_IO`
|
|
44
|
+
- `IPv4API.IPSB` renamed to `IPv4API.IP_SB`
|
|
45
|
+
- `IPv4API.IDENTME` renamed to `IPv4API.IDENT_ME`
|
|
46
|
+
- `IPv4API.TNEDIME` renamed to `IPv4API.TNEDI_ME`
|
|
47
|
+
- `get_public_ipv4` function modified
|
|
48
|
+
- `filter_parameter` function renamed to `_filter_parameter`
|
|
49
|
+
- `README.md` updated
|
|
50
|
+
## [0.3] - 2025-05-19
|
|
51
|
+
### Added
|
|
52
|
+
- `is_ipv4` function
|
|
53
|
+
- `is_loopback` function
|
|
54
|
+
- `IPv4HTTPAdapter` class
|
|
55
|
+
- Support [ident.me](https://ident.me/json)
|
|
56
|
+
- Support [tnedi.me](https://tnedi.me/json)
|
|
57
|
+
### Changed
|
|
58
|
+
- `get_private_ipv4` function modified
|
|
59
|
+
- `get_public_ipv4` function modified
|
|
60
|
+
- `_ipsb_ipv4` function modified
|
|
61
|
+
- `_ipapi_ipv4` function modified
|
|
62
|
+
- `_ipinfo_ipv4` function modified
|
|
63
|
+
- `functions.py` renamed to `utils.py`
|
|
64
|
+
- CLI functions moved to `cli.py`
|
|
65
|
+
- IPv4 functions moved to `ipv4.py`
|
|
66
|
+
- Test system modified
|
|
67
|
+
## [0.2] - 2025-05-04
|
|
68
|
+
### Added
|
|
69
|
+
- Support [ip.sb](https://api.ip.sb/geoip)
|
|
70
|
+
- `--timeout` argument
|
|
71
|
+
### Changed
|
|
72
|
+
- `README.md` updated
|
|
73
|
+
- Requests header updated
|
|
74
|
+
- Test system modified
|
|
75
|
+
## [0.1] - 2025-04-25
|
|
76
|
+
### Added
|
|
77
|
+
- Support [ipinfo.io](https://ipinfo.io)
|
|
78
|
+
- Support [ip-api.com](https://ip-api.com)
|
|
79
|
+
- `get_private_ipv4` function
|
|
80
|
+
- `get_public_ipv4` function
|
|
81
|
+
- `--info` and `--version` arguments
|
|
82
|
+
- `--ipv4-api` argument
|
|
83
|
+
- `--no-geo` argument
|
|
84
|
+
- Logo
|
|
85
|
+
|
|
86
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.5...dev
|
|
87
|
+
[0.5]: https://github.com/openscilab/ipspot/compare/v0.4...v0.5
|
|
88
|
+
[0.4]: https://github.com/openscilab/ipspot/compare/v0.3...v0.4
|
|
89
|
+
[0.3]: https://github.com/openscilab/ipspot/compare/v0.2...v0.3
|
|
90
|
+
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
91
|
+
[0.1]: https://github.com/openscilab/ipspot/compare/3216fb7...v0.1
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ipspot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5
|
|
4
4
|
Summary: IPSpot: A Python Tool to Fetch the System's IP Address
|
|
5
5
|
Home-page: https://github.com/openscilab/ipspot
|
|
6
|
-
Download-URL: https://github.com/openscilab/ipspot/tarball/v0.
|
|
6
|
+
Download-URL: https://github.com/openscilab/ipspot/tarball/v0.5
|
|
7
7
|
Author: IPSpot Development Team
|
|
8
8
|
Author-email: ipspot@openscilab.com
|
|
9
9
|
License: MIT
|
|
10
10
|
Project-URL: Source, https://github.com/openscilab/ipspot
|
|
11
11
|
Keywords: ip ipv4 geo geolocation network location ipspot cli
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
13
|
Classifier: Natural Language :: English
|
|
14
14
|
Classifier: License :: OSI Approved :: MIT License
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
@@ -102,13 +102,13 @@ Dynamic: summary
|
|
|
102
102
|
## Installation
|
|
103
103
|
|
|
104
104
|
### Source Code
|
|
105
|
-
- Download [Version 0.
|
|
105
|
+
- Download [Version 0.5](https://github.com/openscilab/ipspot/archive/v0.5.zip) or [Latest Source](https://github.com/openscilab/ipspot/archive/dev.zip)
|
|
106
106
|
- `pip install .`
|
|
107
107
|
|
|
108
108
|
### PyPI
|
|
109
109
|
|
|
110
110
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
111
|
-
- `pip install ipspot==0.
|
|
111
|
+
- `pip install ipspot==0.5`
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
## Usage
|
|
@@ -119,9 +119,11 @@ Dynamic: summary
|
|
|
119
119
|
|
|
120
120
|
```pycon
|
|
121
121
|
>>> from ipspot import get_public_ipv4, IPv4API
|
|
122
|
-
>>> get_public_ipv4(api=IPv4API.
|
|
122
|
+
>>> get_public_ipv4(api=IPv4API.IP_API_COM)
|
|
123
123
|
{'status': True, 'data': {'ip': 'xx.xx.xx.xx', 'api': 'ip-api.com'}}
|
|
124
|
-
>>> get_public_ipv4(api=IPv4API.
|
|
124
|
+
>>> get_public_ipv4(api=IPv4API.IP_API_COM, geo=True, timeout=10)
|
|
125
|
+
{'data': {'country_code': 'GB', 'latitude': 50.9097, 'longitude': -1.4043, 'api': 'ip-api.com', 'country': 'United Kingdom', 'timezone': 'Europe/London', 'organization': '', 'region': 'England', 'ip': 'xx.xx.xx.xx', 'city': 'Southampton'}, 'status': True}
|
|
126
|
+
>>> get_public_ipv4(api=IPv4API.IP_API_COM, geo=True, timeout=10, max_retries=5, retry_delay=4)
|
|
125
127
|
{'data': {'country_code': 'GB', 'latitude': 50.9097, 'longitude': -1.4043, 'api': 'ip-api.com', 'country': 'United Kingdom', 'timezone': 'Europe/London', 'organization': '', 'region': 'England', 'ip': 'xx.xx.xx.xx', 'city': 'Southampton'}, 'status': True}
|
|
126
128
|
```
|
|
127
129
|
|
|
@@ -133,6 +135,26 @@ Dynamic: summary
|
|
|
133
135
|
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
134
136
|
```
|
|
135
137
|
|
|
138
|
+
#### Public IPv6
|
|
139
|
+
|
|
140
|
+
```pycon
|
|
141
|
+
>>> from ipspot import get_public_ipv6, IPv6API
|
|
142
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB)
|
|
143
|
+
{'data': {'api': 'ip.sb', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
144
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10)
|
|
145
|
+
{'data': {'latitude': 51.2993, 'region': None, 'city': None, 'country_code': 'DE', 'api': 'ip.sb', 'longitude': 9.491, 'country': 'Germany', 'organization': 'Hetzner Online', 'timezone': 'Europe/Berlin', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
146
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10, max_retries=5, retry_delay=4)
|
|
147
|
+
{'data': {'latitude': 51.2993, 'region': None, 'city': None, 'country_code': 'DE', 'api': 'ip.sb', 'longitude': 9.491, 'country': 'Germany', 'organization': 'Hetzner Online', 'timezone': 'Europe/Berlin', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Private IPv6
|
|
151
|
+
|
|
152
|
+
```pycon
|
|
153
|
+
>>> from ipspot import get_private_ipv6
|
|
154
|
+
>>> get_private_ipv6()
|
|
155
|
+
{'status': True, 'data': {'ip': 'fe80::e1bd:f78:b233:21c9'}}
|
|
156
|
+
```
|
|
157
|
+
|
|
136
158
|
### CLI
|
|
137
159
|
|
|
138
160
|
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
@@ -142,7 +164,7 @@ Dynamic: summary
|
|
|
142
164
|
```console
|
|
143
165
|
> ipspot --version
|
|
144
166
|
|
|
145
|
-
0.
|
|
167
|
+
0.5
|
|
146
168
|
```
|
|
147
169
|
|
|
148
170
|
#### Info
|
|
@@ -157,9 +179,9 @@ Dynamic: summary
|
|
|
157
179
|
|___||_| |____/ | .__/ \___/ \__|
|
|
158
180
|
|_|
|
|
159
181
|
|
|
160
|
-
__ __ ___
|
|
161
|
-
\ \ / / _ / _ \ |___
|
|
162
|
-
\ \ / / (_)| | | |
|
|
182
|
+
__ __ ___ ____
|
|
183
|
+
\ \ / / _ / _ \ | ___|
|
|
184
|
+
\ \ / / (_)| | | | |___ \
|
|
163
185
|
\ V / _ | |_| | _ ___) |
|
|
164
186
|
\_/ (_) \___/ (_)|____/
|
|
165
187
|
|
|
@@ -179,7 +201,9 @@ Repo : https://github.com/openscilab/ipspot
|
|
|
179
201
|
> ipspot
|
|
180
202
|
Private IP:
|
|
181
203
|
|
|
182
|
-
|
|
204
|
+
IPv4: 192.168.1.35
|
|
205
|
+
|
|
206
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
183
207
|
|
|
184
208
|
Public IP and Location Info:
|
|
185
209
|
|
|
@@ -197,28 +221,88 @@ Public IP and Location Info:
|
|
|
197
221
|
|
|
198
222
|
#### IPv4 API
|
|
199
223
|
|
|
200
|
-
ℹ️ `ipv4-api` valid choices: [`auto`, `
|
|
224
|
+
ℹ️ `ipv4-api` valid choices: [`auto-safe`, `auto`, `ip-api.com`, `ipinfo.io`, `ip.sb`, `ident.me`, `tnedi.me`, `ipapi.co`, `ipleak.net`, `my-ip.io`, `ifconfig.co`, `reallyfreegeoip.org`, `freeipapi.com`, `myip.la`, `ipquery.io`, `ipwho.is`, `wtfismyip.com`]
|
|
201
225
|
|
|
202
|
-
ℹ️ The default value: `auto`
|
|
226
|
+
ℹ️ The default value: `auto-safe`
|
|
203
227
|
|
|
204
228
|
```console
|
|
205
|
-
> ipspot --ipv4-api="ipinfo"
|
|
229
|
+
> ipspot --ipv4-api="ipinfo.io"
|
|
206
230
|
Private IP:
|
|
207
231
|
|
|
208
|
-
|
|
232
|
+
IPv4: 192.168.1.35
|
|
233
|
+
|
|
234
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
209
235
|
|
|
210
236
|
Public IP and Location Info:
|
|
211
237
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
238
|
+
IPv4:
|
|
239
|
+
|
|
240
|
+
API: ipinfo.io
|
|
241
|
+
City: Nuremberg
|
|
242
|
+
Country: Germany
|
|
243
|
+
Country Code: DE
|
|
244
|
+
IP: xx.xx.xx.xx
|
|
245
|
+
Latitude: 49.4527
|
|
246
|
+
Longitude: 11.0783
|
|
247
|
+
Organization: Hetzner Online GmbH
|
|
248
|
+
Region: Bavaria
|
|
249
|
+
Timezone: Europe/Berlin
|
|
250
|
+
|
|
251
|
+
IPv6:
|
|
252
|
+
|
|
253
|
+
API: ip.sb
|
|
254
|
+
City: N/A
|
|
255
|
+
Country: Germany
|
|
256
|
+
Country Code: DE
|
|
257
|
+
IP: xx:xx:xx:xx::xx
|
|
258
|
+
Latitude: 51.2993
|
|
259
|
+
Longitude: 9.491
|
|
260
|
+
Organization: Hetzner Online
|
|
261
|
+
Region: N/A
|
|
262
|
+
Timezone: Europe/Berlin
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### IPv6 API
|
|
266
|
+
|
|
267
|
+
ℹ️ `ipv6-api` valid choices: [`auto-safe`, `auto`, `ip.sb`, `ident.me`, `tnedi.me`, `ipleak.net`, `my-ip.io`]
|
|
268
|
+
|
|
269
|
+
ℹ️ The default value: `auto-safe`
|
|
270
|
+
|
|
271
|
+
```console
|
|
272
|
+
> ipspot --ipv6-api="ip.sb"
|
|
273
|
+
Private IP:
|
|
274
|
+
|
|
275
|
+
IPv4: 192.168.1.35
|
|
276
|
+
|
|
277
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
278
|
+
|
|
279
|
+
Public IP and Location Info:
|
|
280
|
+
|
|
281
|
+
IPv4:
|
|
282
|
+
|
|
283
|
+
API: ipinfo.io
|
|
284
|
+
City: Nuremberg
|
|
285
|
+
Country: Germany
|
|
286
|
+
Country Code: DE
|
|
287
|
+
IP: xx.xx.xx.xx
|
|
288
|
+
Latitude: 49.4527
|
|
289
|
+
Longitude: 11.0783
|
|
290
|
+
Organization: Hetzner Online GmbH
|
|
291
|
+
Region: Bavaria
|
|
292
|
+
Timezone: Europe/Berlin
|
|
293
|
+
|
|
294
|
+
IPv6:
|
|
295
|
+
|
|
296
|
+
API: ip.sb
|
|
297
|
+
City: N/A
|
|
298
|
+
Country: Germany
|
|
299
|
+
Country Code: DE
|
|
300
|
+
IP: xx:xx:xx:xx::xx
|
|
301
|
+
Latitude: 51.2993
|
|
302
|
+
Longitude: 9.491
|
|
303
|
+
Organization: Hetzner Online
|
|
304
|
+
Region: N/A
|
|
305
|
+
Timezone: Europe/Berlin
|
|
222
306
|
```
|
|
223
307
|
|
|
224
308
|
#### No Geolocation
|
|
@@ -227,12 +311,21 @@ Public IP and Location Info:
|
|
|
227
311
|
> ipspot --no-geo
|
|
228
312
|
Private IP:
|
|
229
313
|
|
|
230
|
-
|
|
314
|
+
IPv4: 192.168.1.35
|
|
315
|
+
|
|
316
|
+
IPv6: fe80::5c40:769f:22de:c196
|
|
231
317
|
|
|
232
318
|
Public IP:
|
|
233
319
|
|
|
234
|
-
|
|
235
|
-
|
|
320
|
+
IPv4:
|
|
321
|
+
|
|
322
|
+
API: tnedi.me
|
|
323
|
+
IP: xx.xx.xx.xx
|
|
324
|
+
|
|
325
|
+
IPv6:
|
|
326
|
+
|
|
327
|
+
API: ip.sb
|
|
328
|
+
IP: xx:xx:xx:xx::xx
|
|
236
329
|
```
|
|
237
330
|
|
|
238
331
|
## Issues & Bug Reports
|
|
@@ -267,6 +360,48 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
267
360
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
268
361
|
|
|
269
362
|
## [Unreleased]
|
|
363
|
+
## [0.5] - 2025-10-17
|
|
364
|
+
### Added
|
|
365
|
+
- `setup-warp` action
|
|
366
|
+
- Support [ipwho.is](https://ipwho.is/)
|
|
367
|
+
- Support [ipquery.io](http://api.ipquery.io/?format=json)
|
|
368
|
+
- Support [wtfismyip.com](https://wtfismyip.com/json)
|
|
369
|
+
- Support [ident.me](https://ident.me/json) IPv6 API
|
|
370
|
+
- Support [tnedi.me](https://tnedi.me/json) IPv6 API
|
|
371
|
+
- Support [ip.sb](https://api.ip.sb/geoip) IPv6 API
|
|
372
|
+
- Support [ipleak.net](https://ipleak.net/json/) IPv6 API
|
|
373
|
+
- Support [my-ip.io](https://www.my-ip.io/) IPv6 API
|
|
374
|
+
- `is_ipv6` function
|
|
375
|
+
- `get_private_ipv6` function
|
|
376
|
+
- `get_public_ipv6` function
|
|
377
|
+
- `IPv6API` enum
|
|
378
|
+
- `--ipv6-api` argument
|
|
379
|
+
### Changed
|
|
380
|
+
- Test system modified
|
|
381
|
+
- `README.md` updated
|
|
382
|
+
## [0.4] - 2025-06-09
|
|
383
|
+
### Added
|
|
384
|
+
- Support [ipapi.co](https://ipapi.co/json/)
|
|
385
|
+
- Support [ipleak.net](https://ipleak.net/json/)
|
|
386
|
+
- Support [my-ip.io](https://www.my-ip.io/)
|
|
387
|
+
- Support [ifconfig.co](https://ifconfig.co/json)
|
|
388
|
+
- Support [reallyfreegeoip.org](https://reallyfreegeoip.org/json/)
|
|
389
|
+
- Support [myip.la](https://api.myip.la/en?json)
|
|
390
|
+
- Support [freeipapi.com](https://freeipapi.com/api/json/)
|
|
391
|
+
- `AUTO_SAFE` mode
|
|
392
|
+
- `_get_json_standard` function
|
|
393
|
+
- `_get_json_ipv4_forced` function
|
|
394
|
+
- `--max-retries` argument
|
|
395
|
+
- `--retry-delay` argument
|
|
396
|
+
### Changed
|
|
397
|
+
- `IPv4API.IPAPI` renamed to `IPv4API.IP_API_COM`
|
|
398
|
+
- `IPv4API.IPINFO` renamed to `IPv4API.IPINFO_IO`
|
|
399
|
+
- `IPv4API.IPSB` renamed to `IPv4API.IP_SB`
|
|
400
|
+
- `IPv4API.IDENTME` renamed to `IPv4API.IDENT_ME`
|
|
401
|
+
- `IPv4API.TNEDIME` renamed to `IPv4API.TNEDI_ME`
|
|
402
|
+
- `get_public_ipv4` function modified
|
|
403
|
+
- `filter_parameter` function renamed to `_filter_parameter`
|
|
404
|
+
- `README.md` updated
|
|
270
405
|
## [0.3] - 2025-05-19
|
|
271
406
|
### Added
|
|
272
407
|
- `is_ipv4` function
|
|
@@ -303,7 +438,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
303
438
|
- `--no-geo` argument
|
|
304
439
|
- Logo
|
|
305
440
|
|
|
306
|
-
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.
|
|
441
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.5...dev
|
|
442
|
+
[0.5]: https://github.com/openscilab/ipspot/compare/v0.4...v0.5
|
|
443
|
+
[0.4]: https://github.com/openscilab/ipspot/compare/v0.3...v0.4
|
|
307
444
|
[0.3]: https://github.com/openscilab/ipspot/compare/v0.2...v0.3
|
|
308
445
|
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
309
446
|
[0.1]: https://github.com/openscilab/ipspot/compare/3216fb7...v0.1
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
## Installation
|
|
53
53
|
|
|
54
54
|
### Source Code
|
|
55
|
-
- Download [Version 0.
|
|
55
|
+
- Download [Version 0.5](https://github.com/openscilab/ipspot/archive/v0.5.zip) or [Latest Source](https://github.com/openscilab/ipspot/archive/dev.zip)
|
|
56
56
|
- `pip install .`
|
|
57
57
|
|
|
58
58
|
### PyPI
|
|
59
59
|
|
|
60
60
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
61
|
-
- `pip install ipspot==0.
|
|
61
|
+
- `pip install ipspot==0.5`
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
## Usage
|
|
@@ -69,9 +69,11 @@
|
|
|
69
69
|
|
|
70
70
|
```pycon
|
|
71
71
|
>>> from ipspot import get_public_ipv4, IPv4API
|
|
72
|
-
>>> get_public_ipv4(api=IPv4API.
|
|
72
|
+
>>> get_public_ipv4(api=IPv4API.IP_API_COM)
|
|
73
73
|
{'status': True, 'data': {'ip': 'xx.xx.xx.xx', 'api': 'ip-api.com'}}
|
|
74
|
-
>>> get_public_ipv4(api=IPv4API.
|
|
74
|
+
>>> get_public_ipv4(api=IPv4API.IP_API_COM, geo=True, timeout=10)
|
|
75
|
+
{'data': {'country_code': 'GB', 'latitude': 50.9097, 'longitude': -1.4043, 'api': 'ip-api.com', 'country': 'United Kingdom', 'timezone': 'Europe/London', 'organization': '', 'region': 'England', 'ip': 'xx.xx.xx.xx', 'city': 'Southampton'}, 'status': True}
|
|
76
|
+
>>> get_public_ipv4(api=IPv4API.IP_API_COM, geo=True, timeout=10, max_retries=5, retry_delay=4)
|
|
75
77
|
{'data': {'country_code': 'GB', 'latitude': 50.9097, 'longitude': -1.4043, 'api': 'ip-api.com', 'country': 'United Kingdom', 'timezone': 'Europe/London', 'organization': '', 'region': 'England', 'ip': 'xx.xx.xx.xx', 'city': 'Southampton'}, 'status': True}
|
|
76
78
|
```
|
|
77
79
|
|
|
@@ -83,6 +85,26 @@
|
|
|
83
85
|
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
84
86
|
```
|
|
85
87
|
|
|
88
|
+
#### Public IPv6
|
|
89
|
+
|
|
90
|
+
```pycon
|
|
91
|
+
>>> from ipspot import get_public_ipv6, IPv6API
|
|
92
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB)
|
|
93
|
+
{'data': {'api': 'ip.sb', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
94
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10)
|
|
95
|
+
{'data': {'latitude': 51.2993, 'region': None, 'city': None, 'country_code': 'DE', 'api': 'ip.sb', 'longitude': 9.491, 'country': 'Germany', 'organization': 'Hetzner Online', 'timezone': 'Europe/Berlin', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
96
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10, max_retries=5, retry_delay=4)
|
|
97
|
+
{'data': {'latitude': 51.2993, 'region': None, 'city': None, 'country_code': 'DE', 'api': 'ip.sb', 'longitude': 9.491, 'country': 'Germany', 'organization': 'Hetzner Online', 'timezone': 'Europe/Berlin', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Private IPv6
|
|
101
|
+
|
|
102
|
+
```pycon
|
|
103
|
+
>>> from ipspot import get_private_ipv6
|
|
104
|
+
>>> get_private_ipv6()
|
|
105
|
+
{'status': True, 'data': {'ip': 'fe80::e1bd:f78:b233:21c9'}}
|
|
106
|
+
```
|
|
107
|
+
|
|
86
108
|
### CLI
|
|
87
109
|
|
|
88
110
|
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
@@ -92,7 +114,7 @@
|
|
|
92
114
|
```console
|
|
93
115
|
> ipspot --version
|
|
94
116
|
|
|
95
|
-
0.
|
|
117
|
+
0.5
|
|
96
118
|
```
|
|
97
119
|
|
|
98
120
|
#### Info
|
|
@@ -107,9 +129,9 @@
|
|
|
107
129
|
|___||_| |____/ | .__/ \___/ \__|
|
|
108
130
|
|_|
|
|
109
131
|
|
|
110
|
-
__ __ ___
|
|
111
|
-
\ \ / / _ / _ \ |___
|
|
112
|
-
\ \ / / (_)| | | |
|
|
132
|
+
__ __ ___ ____
|
|
133
|
+
\ \ / / _ / _ \ | ___|
|
|
134
|
+
\ \ / / (_)| | | | |___ \
|
|
113
135
|
\ V / _ | |_| | _ ___) |
|
|
114
136
|
\_/ (_) \___/ (_)|____/
|
|
115
137
|
|
|
@@ -129,7 +151,9 @@ Repo : https://github.com/openscilab/ipspot
|
|
|
129
151
|
> ipspot
|
|
130
152
|
Private IP:
|
|
131
153
|
|
|
132
|
-
|
|
154
|
+
IPv4: 192.168.1.35
|
|
155
|
+
|
|
156
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
133
157
|
|
|
134
158
|
Public IP and Location Info:
|
|
135
159
|
|
|
@@ -147,28 +171,88 @@ Public IP and Location Info:
|
|
|
147
171
|
|
|
148
172
|
#### IPv4 API
|
|
149
173
|
|
|
150
|
-
ℹ️ `ipv4-api` valid choices: [`auto`, `
|
|
174
|
+
ℹ️ `ipv4-api` valid choices: [`auto-safe`, `auto`, `ip-api.com`, `ipinfo.io`, `ip.sb`, `ident.me`, `tnedi.me`, `ipapi.co`, `ipleak.net`, `my-ip.io`, `ifconfig.co`, `reallyfreegeoip.org`, `freeipapi.com`, `myip.la`, `ipquery.io`, `ipwho.is`, `wtfismyip.com`]
|
|
151
175
|
|
|
152
|
-
ℹ️ The default value: `auto`
|
|
176
|
+
ℹ️ The default value: `auto-safe`
|
|
153
177
|
|
|
154
178
|
```console
|
|
155
|
-
> ipspot --ipv4-api="ipinfo"
|
|
179
|
+
> ipspot --ipv4-api="ipinfo.io"
|
|
156
180
|
Private IP:
|
|
157
181
|
|
|
158
|
-
|
|
182
|
+
IPv4: 192.168.1.35
|
|
183
|
+
|
|
184
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
159
185
|
|
|
160
186
|
Public IP and Location Info:
|
|
161
187
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
188
|
+
IPv4:
|
|
189
|
+
|
|
190
|
+
API: ipinfo.io
|
|
191
|
+
City: Nuremberg
|
|
192
|
+
Country: Germany
|
|
193
|
+
Country Code: DE
|
|
194
|
+
IP: xx.xx.xx.xx
|
|
195
|
+
Latitude: 49.4527
|
|
196
|
+
Longitude: 11.0783
|
|
197
|
+
Organization: Hetzner Online GmbH
|
|
198
|
+
Region: Bavaria
|
|
199
|
+
Timezone: Europe/Berlin
|
|
200
|
+
|
|
201
|
+
IPv6:
|
|
202
|
+
|
|
203
|
+
API: ip.sb
|
|
204
|
+
City: N/A
|
|
205
|
+
Country: Germany
|
|
206
|
+
Country Code: DE
|
|
207
|
+
IP: xx:xx:xx:xx::xx
|
|
208
|
+
Latitude: 51.2993
|
|
209
|
+
Longitude: 9.491
|
|
210
|
+
Organization: Hetzner Online
|
|
211
|
+
Region: N/A
|
|
212
|
+
Timezone: Europe/Berlin
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
#### IPv6 API
|
|
216
|
+
|
|
217
|
+
ℹ️ `ipv6-api` valid choices: [`auto-safe`, `auto`, `ip.sb`, `ident.me`, `tnedi.me`, `ipleak.net`, `my-ip.io`]
|
|
218
|
+
|
|
219
|
+
ℹ️ The default value: `auto-safe`
|
|
220
|
+
|
|
221
|
+
```console
|
|
222
|
+
> ipspot --ipv6-api="ip.sb"
|
|
223
|
+
Private IP:
|
|
224
|
+
|
|
225
|
+
IPv4: 192.168.1.35
|
|
226
|
+
|
|
227
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
228
|
+
|
|
229
|
+
Public IP and Location Info:
|
|
230
|
+
|
|
231
|
+
IPv4:
|
|
232
|
+
|
|
233
|
+
API: ipinfo.io
|
|
234
|
+
City: Nuremberg
|
|
235
|
+
Country: Germany
|
|
236
|
+
Country Code: DE
|
|
237
|
+
IP: xx.xx.xx.xx
|
|
238
|
+
Latitude: 49.4527
|
|
239
|
+
Longitude: 11.0783
|
|
240
|
+
Organization: Hetzner Online GmbH
|
|
241
|
+
Region: Bavaria
|
|
242
|
+
Timezone: Europe/Berlin
|
|
243
|
+
|
|
244
|
+
IPv6:
|
|
245
|
+
|
|
246
|
+
API: ip.sb
|
|
247
|
+
City: N/A
|
|
248
|
+
Country: Germany
|
|
249
|
+
Country Code: DE
|
|
250
|
+
IP: xx:xx:xx:xx::xx
|
|
251
|
+
Latitude: 51.2993
|
|
252
|
+
Longitude: 9.491
|
|
253
|
+
Organization: Hetzner Online
|
|
254
|
+
Region: N/A
|
|
255
|
+
Timezone: Europe/Berlin
|
|
172
256
|
```
|
|
173
257
|
|
|
174
258
|
#### No Geolocation
|
|
@@ -177,12 +261,21 @@ Public IP and Location Info:
|
|
|
177
261
|
> ipspot --no-geo
|
|
178
262
|
Private IP:
|
|
179
263
|
|
|
180
|
-
|
|
264
|
+
IPv4: 192.168.1.35
|
|
265
|
+
|
|
266
|
+
IPv6: fe80::5c40:769f:22de:c196
|
|
181
267
|
|
|
182
268
|
Public IP:
|
|
183
269
|
|
|
184
|
-
|
|
185
|
-
|
|
270
|
+
IPv4:
|
|
271
|
+
|
|
272
|
+
API: tnedi.me
|
|
273
|
+
IP: xx.xx.xx.xx
|
|
274
|
+
|
|
275
|
+
IPv6:
|
|
276
|
+
|
|
277
|
+
API: ip.sb
|
|
278
|
+
IP: xx:xx:xx:xx::xx
|
|
186
279
|
```
|
|
187
280
|
|
|
188
281
|
## Issues & Bug Reports
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""ipspot modules."""
|
|
3
|
-
from .params import IPSPOT_VERSION, IPv4API
|
|
3
|
+
from .params import IPSPOT_VERSION, IPv4API, IPv6API
|
|
4
4
|
from .ipv4 import get_private_ipv4, get_public_ipv4, is_ipv4
|
|
5
|
+
from .ipv6 import get_private_ipv6, get_public_ipv6, is_ipv6
|
|
5
6
|
from .utils import is_loopback
|
|
6
7
|
__version__ = IPSPOT_VERSION
|