ipspot 0.4__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.4 → ipspot-0.5}/CHANGELOG.md +21 -1
- {ipspot-0.4 → ipspot-0.5}/PKG-INFO +139 -28
- {ipspot-0.4 → ipspot-0.5}/README.md +115 -24
- {ipspot-0.4 → ipspot-0.5}/SECURITY.md +2 -2
- {ipspot-0.4 → ipspot-0.5}/dev-requirements.txt +1 -1
- {ipspot-0.4 → ipspot-0.5}/ipspot/__init__.py +2 -1
- {ipspot-0.4 → ipspot-0.5}/ipspot/cli.py +50 -10
- {ipspot-0.4 → ipspot-0.5}/ipspot/ipv4.py +104 -1
- ipspot-0.5/ipspot/ipv6.py +245 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot/params.py +16 -1
- {ipspot-0.4 → ipspot-0.5}/ipspot.egg-info/PKG-INFO +139 -28
- {ipspot-0.4 → ipspot-0.5}/ipspot.egg-info/SOURCES.txt +5 -1
- {ipspot-0.4 → ipspot-0.5}/setup.py +3 -3
- ipspot-0.5/tests/test_ipv4_api.py +139 -0
- ipspot-0.4/tests/test_ipv4.py → ipspot-0.5/tests/test_ipv4_functions.py +63 -85
- ipspot-0.5/tests/test_ipv6_api.py +58 -0
- ipspot-0.5/tests/test_ipv6_functions.py +61 -0
- {ipspot-0.4 → ipspot-0.5}/AUTHORS.md +0 -0
- {ipspot-0.4 → ipspot-0.5}/LICENSE +0 -0
- {ipspot-0.4 → ipspot-0.5}/MANIFEST.in +0 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot/__main__.py +0 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot/utils.py +0 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot.egg-info/dependency_links.txt +0 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot.egg-info/entry_points.txt +0 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot.egg-info/requires.txt +0 -0
- {ipspot-0.4 → ipspot-0.5}/ipspot.egg-info/top_level.txt +0 -0
- {ipspot-0.4 → ipspot-0.5}/requirements.txt +0 -0
- {ipspot-0.4 → ipspot-0.5}/setup.cfg +0 -0
- {ipspot-0.4 → ipspot-0.5}/tests/test_utils.py +0 -0
|
@@ -5,6 +5,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
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
|
|
8
27
|
## [0.4] - 2025-06-09
|
|
9
28
|
### Added
|
|
10
29
|
- Support [ipapi.co](https://ipapi.co/json/)
|
|
@@ -64,7 +83,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
64
83
|
- `--no-geo` argument
|
|
65
84
|
- Logo
|
|
66
85
|
|
|
67
|
-
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.
|
|
86
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.5...dev
|
|
87
|
+
[0.5]: https://github.com/openscilab/ipspot/compare/v0.4...v0.5
|
|
68
88
|
[0.4]: https://github.com/openscilab/ipspot/compare/v0.3...v0.4
|
|
69
89
|
[0.3]: https://github.com/openscilab/ipspot/compare/v0.2...v0.3
|
|
70
90
|
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
@@ -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
|
|
@@ -135,6 +135,26 @@ Dynamic: summary
|
|
|
135
135
|
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
136
136
|
```
|
|
137
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
|
+
|
|
138
158
|
### CLI
|
|
139
159
|
|
|
140
160
|
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
@@ -144,7 +164,7 @@ Dynamic: summary
|
|
|
144
164
|
```console
|
|
145
165
|
> ipspot --version
|
|
146
166
|
|
|
147
|
-
0.
|
|
167
|
+
0.5
|
|
148
168
|
```
|
|
149
169
|
|
|
150
170
|
#### Info
|
|
@@ -159,11 +179,11 @@ Dynamic: summary
|
|
|
159
179
|
|___||_| |____/ | .__/ \___/ \__|
|
|
160
180
|
|_|
|
|
161
181
|
|
|
162
|
-
__ __ ___
|
|
163
|
-
\ \ / / _ / _ \ |
|
|
164
|
-
\ \ / / (_)| | | | |
|
|
165
|
-
\ V / _ | |_| | _ |
|
|
166
|
-
\_/ (_) \___/ (_)
|
|
182
|
+
__ __ ___ ____
|
|
183
|
+
\ \ / / _ / _ \ | ___|
|
|
184
|
+
\ \ / / (_)| | | | |___ \
|
|
185
|
+
\ V / _ | |_| | _ ___) |
|
|
186
|
+
\_/ (_) \___/ (_)|____/
|
|
167
187
|
|
|
168
188
|
|
|
169
189
|
|
|
@@ -181,7 +201,9 @@ Repo : https://github.com/openscilab/ipspot
|
|
|
181
201
|
> ipspot
|
|
182
202
|
Private IP:
|
|
183
203
|
|
|
184
|
-
|
|
204
|
+
IPv4: 192.168.1.35
|
|
205
|
+
|
|
206
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
185
207
|
|
|
186
208
|
Public IP and Location Info:
|
|
187
209
|
|
|
@@ -199,7 +221,7 @@ Public IP and Location Info:
|
|
|
199
221
|
|
|
200
222
|
#### IPv4 API
|
|
201
223
|
|
|
202
|
-
ℹ️ `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`]
|
|
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`]
|
|
203
225
|
|
|
204
226
|
ℹ️ The default value: `auto-safe`
|
|
205
227
|
|
|
@@ -207,20 +229,80 @@ Public IP and Location Info:
|
|
|
207
229
|
> ipspot --ipv4-api="ipinfo.io"
|
|
208
230
|
Private IP:
|
|
209
231
|
|
|
210
|
-
|
|
232
|
+
IPv4: 192.168.1.35
|
|
233
|
+
|
|
234
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
211
235
|
|
|
212
236
|
Public IP and Location Info:
|
|
213
237
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
|
224
306
|
```
|
|
225
307
|
|
|
226
308
|
#### No Geolocation
|
|
@@ -229,12 +311,21 @@ Public IP and Location Info:
|
|
|
229
311
|
> ipspot --no-geo
|
|
230
312
|
Private IP:
|
|
231
313
|
|
|
232
|
-
|
|
314
|
+
IPv4: 192.168.1.35
|
|
315
|
+
|
|
316
|
+
IPv6: fe80::5c40:769f:22de:c196
|
|
233
317
|
|
|
234
318
|
Public IP:
|
|
235
319
|
|
|
236
|
-
|
|
237
|
-
|
|
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
|
|
238
329
|
```
|
|
239
330
|
|
|
240
331
|
## Issues & Bug Reports
|
|
@@ -269,6 +360,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
269
360
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
270
361
|
|
|
271
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
|
|
272
382
|
## [0.4] - 2025-06-09
|
|
273
383
|
### Added
|
|
274
384
|
- Support [ipapi.co](https://ipapi.co/json/)
|
|
@@ -328,7 +438,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
328
438
|
- `--no-geo` argument
|
|
329
439
|
- Logo
|
|
330
440
|
|
|
331
|
-
[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
|
|
332
443
|
[0.4]: https://github.com/openscilab/ipspot/compare/v0.3...v0.4
|
|
333
444
|
[0.3]: https://github.com/openscilab/ipspot/compare/v0.2...v0.3
|
|
334
445
|
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
@@ -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
|
|
@@ -85,6 +85,26 @@
|
|
|
85
85
|
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
86
86
|
```
|
|
87
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
|
+
|
|
88
108
|
### CLI
|
|
89
109
|
|
|
90
110
|
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
@@ -94,7 +114,7 @@
|
|
|
94
114
|
```console
|
|
95
115
|
> ipspot --version
|
|
96
116
|
|
|
97
|
-
0.
|
|
117
|
+
0.5
|
|
98
118
|
```
|
|
99
119
|
|
|
100
120
|
#### Info
|
|
@@ -109,11 +129,11 @@
|
|
|
109
129
|
|___||_| |____/ | .__/ \___/ \__|
|
|
110
130
|
|_|
|
|
111
131
|
|
|
112
|
-
__ __ ___
|
|
113
|
-
\ \ / / _ / _ \ |
|
|
114
|
-
\ \ / / (_)| | | | |
|
|
115
|
-
\ V / _ | |_| | _ |
|
|
116
|
-
\_/ (_) \___/ (_)
|
|
132
|
+
__ __ ___ ____
|
|
133
|
+
\ \ / / _ / _ \ | ___|
|
|
134
|
+
\ \ / / (_)| | | | |___ \
|
|
135
|
+
\ V / _ | |_| | _ ___) |
|
|
136
|
+
\_/ (_) \___/ (_)|____/
|
|
117
137
|
|
|
118
138
|
|
|
119
139
|
|
|
@@ -131,7 +151,9 @@ Repo : https://github.com/openscilab/ipspot
|
|
|
131
151
|
> ipspot
|
|
132
152
|
Private IP:
|
|
133
153
|
|
|
134
|
-
|
|
154
|
+
IPv4: 192.168.1.35
|
|
155
|
+
|
|
156
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
135
157
|
|
|
136
158
|
Public IP and Location Info:
|
|
137
159
|
|
|
@@ -149,7 +171,7 @@ Public IP and Location Info:
|
|
|
149
171
|
|
|
150
172
|
#### IPv4 API
|
|
151
173
|
|
|
152
|
-
ℹ️ `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`]
|
|
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`]
|
|
153
175
|
|
|
154
176
|
ℹ️ The default value: `auto-safe`
|
|
155
177
|
|
|
@@ -157,20 +179,80 @@ Public IP and Location Info:
|
|
|
157
179
|
> ipspot --ipv4-api="ipinfo.io"
|
|
158
180
|
Private IP:
|
|
159
181
|
|
|
160
|
-
|
|
182
|
+
IPv4: 192.168.1.35
|
|
183
|
+
|
|
184
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
161
185
|
|
|
162
186
|
Public IP and Location Info:
|
|
163
187
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
|
174
256
|
```
|
|
175
257
|
|
|
176
258
|
#### No Geolocation
|
|
@@ -179,12 +261,21 @@ Public IP and Location Info:
|
|
|
179
261
|
> ipspot --no-geo
|
|
180
262
|
Private IP:
|
|
181
263
|
|
|
182
|
-
|
|
264
|
+
IPv4: 192.168.1.35
|
|
265
|
+
|
|
266
|
+
IPv6: fe80::5c40:769f:22de:c196
|
|
183
267
|
|
|
184
268
|
Public IP:
|
|
185
269
|
|
|
186
|
-
|
|
187
|
-
|
|
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
|
|
188
279
|
```
|
|
189
280
|
|
|
190
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
|
|
@@ -4,8 +4,9 @@ import argparse
|
|
|
4
4
|
from typing import Union, Tuple
|
|
5
5
|
from art import tprint
|
|
6
6
|
from .ipv4 import get_public_ipv4, get_private_ipv4
|
|
7
|
+
from .ipv6 import get_public_ipv6, get_private_ipv6
|
|
7
8
|
from .utils import _filter_parameter
|
|
8
|
-
from .params import IPv4API, PARAMETERS_NAME_MAP
|
|
9
|
+
from .params import IPv4API, IPv6API, PARAMETERS_NAME_MAP
|
|
9
10
|
from .params import IPSPOT_OVERVIEW, IPSPOT_REPO, IPSPOT_VERSION
|
|
10
11
|
|
|
11
12
|
|
|
@@ -17,42 +18,72 @@ def ipspot_info() -> None: # pragma: no cover
|
|
|
17
18
|
print("Repo : " + IPSPOT_REPO)
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
def display_ip_info(ipv4_api: IPv4API = IPv4API.AUTO_SAFE,
|
|
21
|
+
def display_ip_info(ipv4_api: IPv4API = IPv4API.AUTO_SAFE,
|
|
22
|
+
ipv6_api: IPv6API = IPv6API.AUTO_SAFE,
|
|
23
|
+
geo: bool=False,
|
|
21
24
|
timeout: Union[float, Tuple[float, float]]=5,
|
|
22
25
|
max_retries: int = 0, retry_delay: float = 1.0) -> None: # pragma: no cover
|
|
23
26
|
"""
|
|
24
27
|
Print collected IP and location data.
|
|
25
28
|
|
|
26
29
|
:param ipv4_api: public IPv4 API
|
|
30
|
+
:param ipv6_api: public IPv6 API
|
|
27
31
|
:param geo: geolocation flag
|
|
28
32
|
:param timeout: timeout value for API
|
|
29
33
|
:param max_retries: number of retries
|
|
30
34
|
:param retry_delay: delay between retries (in seconds)
|
|
31
35
|
"""
|
|
32
|
-
private_result = get_private_ipv4()
|
|
33
36
|
print("Private IP:\n")
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
private_ipv4_result = get_private_ipv4()
|
|
38
|
+
if private_ipv4_result["status"]:
|
|
39
|
+
private_ipv4 = private_ipv4_result["data"]["ip"]
|
|
40
|
+
else:
|
|
41
|
+
private_ipv4 = private_ipv4_result["error"]
|
|
42
|
+
print(" IPv4: {private_ipv4}\n".format(private_ipv4=private_ipv4))
|
|
43
|
+
|
|
44
|
+
private_ipv6_result = get_private_ipv6()
|
|
45
|
+
if private_ipv6_result["status"]:
|
|
46
|
+
private_ipv6 = private_ipv6_result["data"]["ip"]
|
|
47
|
+
else:
|
|
48
|
+
private_ipv6 = private_ipv6_result["error"]
|
|
49
|
+
print(" IPv6: {private_ipv6}".format(private_ipv6=private_ipv6))
|
|
36
50
|
|
|
37
51
|
public_title = "\nPublic IP"
|
|
38
52
|
if geo:
|
|
39
53
|
public_title += " and Location Info"
|
|
40
54
|
public_title += ":\n"
|
|
41
55
|
print(public_title)
|
|
42
|
-
|
|
56
|
+
print(" IPv4:\n")
|
|
57
|
+
public_ipv4_result = get_public_ipv4(
|
|
43
58
|
ipv4_api,
|
|
44
59
|
geo=geo,
|
|
45
60
|
timeout=timeout,
|
|
46
61
|
max_retries=max_retries,
|
|
47
62
|
retry_delay=retry_delay)
|
|
48
|
-
if
|
|
49
|
-
for name, parameter in sorted(
|
|
63
|
+
if public_ipv4_result["status"]:
|
|
64
|
+
for name, parameter in sorted(public_ipv4_result["data"].items()):
|
|
50
65
|
print(
|
|
51
|
-
"
|
|
66
|
+
" {name}: {parameter}".format(
|
|
52
67
|
name=PARAMETERS_NAME_MAP[name],
|
|
53
68
|
parameter=_filter_parameter(parameter)))
|
|
54
69
|
else:
|
|
55
|
-
print("
|
|
70
|
+
print(" Error: {public_ipv4_result[error]}".format(public_ipv4_result=public_ipv4_result))
|
|
71
|
+
|
|
72
|
+
print("\n IPv6:\n")
|
|
73
|
+
public_ipv6_result = get_public_ipv6(
|
|
74
|
+
ipv6_api,
|
|
75
|
+
geo=geo,
|
|
76
|
+
timeout=timeout,
|
|
77
|
+
max_retries=max_retries,
|
|
78
|
+
retry_delay=retry_delay)
|
|
79
|
+
if public_ipv6_result["status"]:
|
|
80
|
+
for name, parameter in sorted(public_ipv6_result["data"].items()):
|
|
81
|
+
print(
|
|
82
|
+
" {name}: {parameter}".format(
|
|
83
|
+
name=PARAMETERS_NAME_MAP[name],
|
|
84
|
+
parameter=_filter_parameter(parameter)))
|
|
85
|
+
else:
|
|
86
|
+
print(" Error: {public_ipv6_result[error]}".format(public_ipv6_result=public_ipv6_result))
|
|
56
87
|
|
|
57
88
|
|
|
58
89
|
def main() -> None: # pragma: no cover
|
|
@@ -65,6 +96,13 @@ def main() -> None: # pragma: no cover
|
|
|
65
96
|
choices=[
|
|
66
97
|
x.value for x in IPv4API],
|
|
67
98
|
default=IPv4API.AUTO_SAFE.value)
|
|
99
|
+
parser.add_argument(
|
|
100
|
+
'--ipv6-api',
|
|
101
|
+
help='public IPv6 API',
|
|
102
|
+
type=str.lower,
|
|
103
|
+
choices=[
|
|
104
|
+
x.value for x in IPv6API],
|
|
105
|
+
default=IPv6API.AUTO_SAFE.value)
|
|
68
106
|
parser.add_argument('--info', help='info', nargs="?", const=1)
|
|
69
107
|
parser.add_argument('--version', help='version', nargs="?", const=1)
|
|
70
108
|
parser.add_argument('--no-geo', help='no geolocation data', nargs="?", const=1, default=False)
|
|
@@ -79,9 +117,11 @@ def main() -> None: # pragma: no cover
|
|
|
79
117
|
ipspot_info()
|
|
80
118
|
else:
|
|
81
119
|
ipv4_api = IPv4API(args.ipv4_api)
|
|
120
|
+
ipv6_api = IPv6API(args.ipv6_api)
|
|
82
121
|
geo = not args.no_geo
|
|
83
122
|
display_ip_info(
|
|
84
123
|
ipv4_api=ipv4_api,
|
|
124
|
+
ipv6_api=ipv6_api,
|
|
85
125
|
geo=geo,
|
|
86
126
|
timeout=args.timeout,
|
|
87
127
|
max_retries=args.max_retries,
|