ipspot 0.4__tar.gz → 0.6__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.6}/CHANGELOG.md +36 -1
- {ipspot-0.4 → ipspot-0.6}/PKG-INFO +180 -38
- {ipspot-0.4 → ipspot-0.6}/README.md +141 -34
- {ipspot-0.4 → ipspot-0.6}/SECURITY.md +2 -2
- {ipspot-0.4 → ipspot-0.6}/dev-requirements.txt +1 -1
- {ipspot-0.4 → ipspot-0.6}/ipspot/__init__.py +2 -1
- {ipspot-0.4 → ipspot-0.6}/ipspot/cli.py +50 -10
- {ipspot-0.4 → ipspot-0.6}/ipspot/ipv4.py +117 -73
- ipspot-0.6/ipspot/ipv6.py +380 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot/params.py +20 -1
- ipspot-0.6/ipspot/utils.py +132 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot.egg-info/PKG-INFO +180 -38
- {ipspot-0.4 → ipspot-0.6}/ipspot.egg-info/SOURCES.txt +5 -1
- {ipspot-0.4 → ipspot-0.6}/setup.py +3 -3
- ipspot-0.6/tests/test_ipv4_api.py +139 -0
- ipspot-0.4/tests/test_ipv4.py → ipspot-0.6/tests/test_ipv4_functions.py +63 -85
- ipspot-0.6/tests/test_ipv6_api.py +90 -0
- ipspot-0.6/tests/test_ipv6_functions.py +61 -0
- ipspot-0.4/ipspot/utils.py +0 -69
- {ipspot-0.4 → ipspot-0.6}/AUTHORS.md +0 -0
- {ipspot-0.4 → ipspot-0.6}/LICENSE +0 -0
- {ipspot-0.4 → ipspot-0.6}/MANIFEST.in +0 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot/__main__.py +0 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot.egg-info/dependency_links.txt +0 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot.egg-info/entry_points.txt +0 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot.egg-info/requires.txt +0 -0
- {ipspot-0.4 → ipspot-0.6}/ipspot.egg-info/top_level.txt +0 -0
- {ipspot-0.4 → ipspot-0.6}/requirements.txt +0 -0
- {ipspot-0.4 → ipspot-0.6}/setup.cfg +0 -0
- {ipspot-0.4 → ipspot-0.6}/tests/test_utils.py +0 -0
|
@@ -5,6 +5,39 @@ 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.6] - 2025-11-18
|
|
9
|
+
### Added
|
|
10
|
+
- `ForceIPHTTPAdapter` class
|
|
11
|
+
- `_get_json_force_ip` function
|
|
12
|
+
- Support [ifconfig.co](https://ifconfig.co/json) IPv6 API
|
|
13
|
+
- Support [reallyfreegeoip.org](https://reallyfreegeoip.org/json/) IPv6 API
|
|
14
|
+
- Support [myip.la](https://api.myip.la/en?json) IPv6 API
|
|
15
|
+
- Support [freeipapi.com](https://freeipapi.com/api/json) IPv6 API
|
|
16
|
+
### Changed
|
|
17
|
+
- [freeipapi.com](https://freeipapi.com/api/json) IPv4 API bug fixed
|
|
18
|
+
- `README.md` updated
|
|
19
|
+
### Removed
|
|
20
|
+
- `IPv4HTTPAdapter` class
|
|
21
|
+
- `_get_json_ipv4_forced` function
|
|
22
|
+
## [0.5] - 2025-10-17
|
|
23
|
+
### Added
|
|
24
|
+
- `setup-warp` action
|
|
25
|
+
- Support [ipwho.is](https://ipwho.is/)
|
|
26
|
+
- Support [ipquery.io](http://api.ipquery.io/?format=json)
|
|
27
|
+
- Support [wtfismyip.com](https://wtfismyip.com/json)
|
|
28
|
+
- Support [ident.me](https://ident.me/json) IPv6 API
|
|
29
|
+
- Support [tnedi.me](https://tnedi.me/json) IPv6 API
|
|
30
|
+
- Support [ip.sb](https://api.ip.sb/geoip) IPv6 API
|
|
31
|
+
- Support [ipleak.net](https://ipleak.net/json/) IPv6 API
|
|
32
|
+
- Support [my-ip.io](https://www.my-ip.io/) IPv6 API
|
|
33
|
+
- `is_ipv6` function
|
|
34
|
+
- `get_private_ipv6` function
|
|
35
|
+
- `get_public_ipv6` function
|
|
36
|
+
- `IPv6API` enum
|
|
37
|
+
- `--ipv6-api` argument
|
|
38
|
+
### Changed
|
|
39
|
+
- Test system modified
|
|
40
|
+
- `README.md` updated
|
|
8
41
|
## [0.4] - 2025-06-09
|
|
9
42
|
### Added
|
|
10
43
|
- Support [ipapi.co](https://ipapi.co/json/)
|
|
@@ -64,7 +97,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
64
97
|
- `--no-geo` argument
|
|
65
98
|
- Logo
|
|
66
99
|
|
|
67
|
-
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.
|
|
100
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.6...dev
|
|
101
|
+
[0.6]: https://github.com/openscilab/ipspot/compare/v0.5...v0.6
|
|
102
|
+
[0.5]: https://github.com/openscilab/ipspot/compare/v0.4...v0.5
|
|
68
103
|
[0.4]: https://github.com/openscilab/ipspot/compare/v0.3...v0.4
|
|
69
104
|
[0.3]: https://github.com/openscilab/ipspot/compare/v0.2...v0.3
|
|
70
105
|
[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.6
|
|
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.6
|
|
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 :: 4 - Beta
|
|
13
13
|
Classifier: Natural Language :: English
|
|
14
14
|
Classifier: License :: OSI Approved :: MIT License
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
@@ -52,6 +52,7 @@ Dynamic: summary
|
|
|
52
52
|
<img src="https://github.com/openscilab/ipspot/raw/main/otherfiles/logo.png" width="350">
|
|
53
53
|
<h1>IPSpot: A Python Tool to Fetch the System's IP Address</h1>
|
|
54
54
|
<br/>
|
|
55
|
+
<a href="https://codecov.io/gh/openscilab/ipspot"><img src="https://codecov.io/gh/openscilab/ipspot/graph/badge.svg?token=XCFKASULS8"></a>
|
|
55
56
|
<a href="https://badge.fury.io/py/ipspot"><img src="https://badge.fury.io/py/ipspot.svg" alt="PyPI version"></a>
|
|
56
57
|
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
|
|
57
58
|
<a href="https://github.com/openscilab/ipspot"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/ipspot"></a>
|
|
@@ -102,13 +103,13 @@ Dynamic: summary
|
|
|
102
103
|
## Installation
|
|
103
104
|
|
|
104
105
|
### Source Code
|
|
105
|
-
- Download [Version 0.
|
|
106
|
+
- Download [Version 0.6](https://github.com/openscilab/ipspot/archive/v0.6.zip) or [Latest Source](https://github.com/openscilab/ipspot/archive/dev.zip)
|
|
106
107
|
- `pip install .`
|
|
107
108
|
|
|
108
109
|
### PyPI
|
|
109
110
|
|
|
110
111
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
111
|
-
- `pip install ipspot==0.
|
|
112
|
+
- `pip install ipspot==0.6`
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
## Usage
|
|
@@ -135,6 +136,26 @@ Dynamic: summary
|
|
|
135
136
|
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
136
137
|
```
|
|
137
138
|
|
|
139
|
+
#### Public IPv6
|
|
140
|
+
|
|
141
|
+
```pycon
|
|
142
|
+
>>> from ipspot import get_public_ipv6, IPv6API
|
|
143
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB)
|
|
144
|
+
{'data': {'api': 'ip.sb', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
145
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10)
|
|
146
|
+
{'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}
|
|
147
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10, max_retries=5, retry_delay=4)
|
|
148
|
+
{'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}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Private IPv6
|
|
152
|
+
|
|
153
|
+
```pycon
|
|
154
|
+
>>> from ipspot import get_private_ipv6
|
|
155
|
+
>>> get_private_ipv6()
|
|
156
|
+
{'status': True, 'data': {'ip': 'fe80::e1bd:f78:b233:21c9'}}
|
|
157
|
+
```
|
|
158
|
+
|
|
138
159
|
### CLI
|
|
139
160
|
|
|
140
161
|
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
@@ -144,7 +165,7 @@ Dynamic: summary
|
|
|
144
165
|
```console
|
|
145
166
|
> ipspot --version
|
|
146
167
|
|
|
147
|
-
0.
|
|
168
|
+
0.6
|
|
148
169
|
```
|
|
149
170
|
|
|
150
171
|
#### Info
|
|
@@ -159,11 +180,11 @@ Dynamic: summary
|
|
|
159
180
|
|___||_| |____/ | .__/ \___/ \__|
|
|
160
181
|
|_|
|
|
161
182
|
|
|
162
|
-
__ __ ___
|
|
163
|
-
\ \ / / _ / _ \
|
|
164
|
-
\ \ / / (_)| | | | |
|
|
165
|
-
\ V / _ | |_| | _ |
|
|
166
|
-
\_/ (_) \___/ (_)
|
|
183
|
+
__ __ ___ __
|
|
184
|
+
\ \ / / _ / _ \ / /_
|
|
185
|
+
\ \ / / (_)| | | | | '_ \
|
|
186
|
+
\ V / _ | |_| | _ | (_) |
|
|
187
|
+
\_/ (_) \___/ (_) \___/
|
|
167
188
|
|
|
168
189
|
|
|
169
190
|
|
|
@@ -181,25 +202,42 @@ Repo : https://github.com/openscilab/ipspot
|
|
|
181
202
|
> ipspot
|
|
182
203
|
Private IP:
|
|
183
204
|
|
|
184
|
-
|
|
205
|
+
IPv4: 192.168.1.35
|
|
206
|
+
|
|
207
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
185
208
|
|
|
186
209
|
Public IP and Location Info:
|
|
187
210
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
IPv4:
|
|
212
|
+
|
|
213
|
+
API: ipinfo.io
|
|
214
|
+
City: Nuremberg
|
|
215
|
+
Country: Germany
|
|
216
|
+
Country Code: DE
|
|
217
|
+
IP: xx.xx.xx.xx
|
|
218
|
+
Latitude: 49.4527
|
|
219
|
+
Longitude: 11.0783
|
|
220
|
+
Organization: Hetzner Online GmbH
|
|
221
|
+
Region: Bavaria
|
|
222
|
+
Timezone: Europe/Berlin
|
|
223
|
+
|
|
224
|
+
IPv6:
|
|
225
|
+
|
|
226
|
+
API: ip.sb
|
|
227
|
+
City: N/A
|
|
228
|
+
Country: Germany
|
|
229
|
+
Country Code: DE
|
|
230
|
+
IP: xx:xx:xx:xx::xx
|
|
231
|
+
Latitude: 51.2993
|
|
232
|
+
Longitude: 9.491
|
|
233
|
+
Organization: Hetzner Online
|
|
234
|
+
Region: N/A
|
|
235
|
+
Timezone: Europe/Berlin
|
|
198
236
|
```
|
|
199
237
|
|
|
200
238
|
#### IPv4 API
|
|
201
239
|
|
|
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`]
|
|
240
|
+
ℹ️ `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
241
|
|
|
204
242
|
ℹ️ The default value: `auto-safe`
|
|
205
243
|
|
|
@@ -207,20 +245,80 @@ Public IP and Location Info:
|
|
|
207
245
|
> ipspot --ipv4-api="ipinfo.io"
|
|
208
246
|
Private IP:
|
|
209
247
|
|
|
210
|
-
|
|
248
|
+
IPv4: 192.168.1.35
|
|
249
|
+
|
|
250
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
251
|
+
|
|
252
|
+
Public IP and Location Info:
|
|
253
|
+
|
|
254
|
+
IPv4:
|
|
255
|
+
|
|
256
|
+
API: ipinfo.io
|
|
257
|
+
City: Nuremberg
|
|
258
|
+
Country: Germany
|
|
259
|
+
Country Code: DE
|
|
260
|
+
IP: xx.xx.xx.xx
|
|
261
|
+
Latitude: 49.4527
|
|
262
|
+
Longitude: 11.0783
|
|
263
|
+
Organization: Hetzner Online GmbH
|
|
264
|
+
Region: Bavaria
|
|
265
|
+
Timezone: Europe/Berlin
|
|
266
|
+
|
|
267
|
+
IPv6:
|
|
268
|
+
|
|
269
|
+
API: ip.sb
|
|
270
|
+
City: N/A
|
|
271
|
+
Country: Germany
|
|
272
|
+
Country Code: DE
|
|
273
|
+
IP: xx:xx:xx:xx::xx
|
|
274
|
+
Latitude: 51.2993
|
|
275
|
+
Longitude: 9.491
|
|
276
|
+
Organization: Hetzner Online
|
|
277
|
+
Region: N/A
|
|
278
|
+
Timezone: Europe/Berlin
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### IPv6 API
|
|
282
|
+
|
|
283
|
+
ℹ️ `ipv6-api` valid choices: [`auto-safe`, `auto`, `ip.sb`, `ident.me`, `tnedi.me`, `ipleak.net`, `my-ip.io`, `ifconfig.co`, `reallyfreegeoip.org`, `myip.la`, `freeipapi.com`]
|
|
284
|
+
|
|
285
|
+
ℹ️ The default value: `auto-safe`
|
|
286
|
+
|
|
287
|
+
```console
|
|
288
|
+
> ipspot --ipv6-api="ip.sb"
|
|
289
|
+
Private IP:
|
|
290
|
+
|
|
291
|
+
IPv4: 192.168.1.35
|
|
292
|
+
|
|
293
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
211
294
|
|
|
212
295
|
Public IP and Location Info:
|
|
213
296
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
297
|
+
IPv4:
|
|
298
|
+
|
|
299
|
+
API: ipinfo.io
|
|
300
|
+
City: Nuremberg
|
|
301
|
+
Country: Germany
|
|
302
|
+
Country Code: DE
|
|
303
|
+
IP: xx.xx.xx.xx
|
|
304
|
+
Latitude: 49.4527
|
|
305
|
+
Longitude: 11.0783
|
|
306
|
+
Organization: Hetzner Online GmbH
|
|
307
|
+
Region: Bavaria
|
|
308
|
+
Timezone: Europe/Berlin
|
|
309
|
+
|
|
310
|
+
IPv6:
|
|
311
|
+
|
|
312
|
+
API: ip.sb
|
|
313
|
+
City: N/A
|
|
314
|
+
Country: Germany
|
|
315
|
+
Country Code: DE
|
|
316
|
+
IP: xx:xx:xx:xx::xx
|
|
317
|
+
Latitude: 51.2993
|
|
318
|
+
Longitude: 9.491
|
|
319
|
+
Organization: Hetzner Online
|
|
320
|
+
Region: N/A
|
|
321
|
+
Timezone: Europe/Berlin
|
|
224
322
|
```
|
|
225
323
|
|
|
226
324
|
#### No Geolocation
|
|
@@ -229,12 +327,21 @@ Public IP and Location Info:
|
|
|
229
327
|
> ipspot --no-geo
|
|
230
328
|
Private IP:
|
|
231
329
|
|
|
232
|
-
|
|
330
|
+
IPv4: 192.168.1.35
|
|
331
|
+
|
|
332
|
+
IPv6: fe80::5c40:769f:22de:c196
|
|
233
333
|
|
|
234
334
|
Public IP:
|
|
235
335
|
|
|
236
|
-
|
|
237
|
-
|
|
336
|
+
IPv4:
|
|
337
|
+
|
|
338
|
+
API: tnedi.me
|
|
339
|
+
IP: xx.xx.xx.xx
|
|
340
|
+
|
|
341
|
+
IPv6:
|
|
342
|
+
|
|
343
|
+
API: ip.sb
|
|
344
|
+
IP: xx:xx:xx:xx::xx
|
|
238
345
|
```
|
|
239
346
|
|
|
240
347
|
## Issues & Bug Reports
|
|
@@ -269,6 +376,39 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
269
376
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
270
377
|
|
|
271
378
|
## [Unreleased]
|
|
379
|
+
## [0.6] - 2025-11-18
|
|
380
|
+
### Added
|
|
381
|
+
- `ForceIPHTTPAdapter` class
|
|
382
|
+
- `_get_json_force_ip` function
|
|
383
|
+
- Support [ifconfig.co](https://ifconfig.co/json) IPv6 API
|
|
384
|
+
- Support [reallyfreegeoip.org](https://reallyfreegeoip.org/json/) IPv6 API
|
|
385
|
+
- Support [myip.la](https://api.myip.la/en?json) IPv6 API
|
|
386
|
+
- Support [freeipapi.com](https://freeipapi.com/api/json) IPv6 API
|
|
387
|
+
### Changed
|
|
388
|
+
- [freeipapi.com](https://freeipapi.com/api/json) IPv4 API bug fixed
|
|
389
|
+
- `README.md` updated
|
|
390
|
+
### Removed
|
|
391
|
+
- `IPv4HTTPAdapter` class
|
|
392
|
+
- `_get_json_ipv4_forced` function
|
|
393
|
+
## [0.5] - 2025-10-17
|
|
394
|
+
### Added
|
|
395
|
+
- `setup-warp` action
|
|
396
|
+
- Support [ipwho.is](https://ipwho.is/)
|
|
397
|
+
- Support [ipquery.io](http://api.ipquery.io/?format=json)
|
|
398
|
+
- Support [wtfismyip.com](https://wtfismyip.com/json)
|
|
399
|
+
- Support [ident.me](https://ident.me/json) IPv6 API
|
|
400
|
+
- Support [tnedi.me](https://tnedi.me/json) IPv6 API
|
|
401
|
+
- Support [ip.sb](https://api.ip.sb/geoip) IPv6 API
|
|
402
|
+
- Support [ipleak.net](https://ipleak.net/json/) IPv6 API
|
|
403
|
+
- Support [my-ip.io](https://www.my-ip.io/) IPv6 API
|
|
404
|
+
- `is_ipv6` function
|
|
405
|
+
- `get_private_ipv6` function
|
|
406
|
+
- `get_public_ipv6` function
|
|
407
|
+
- `IPv6API` enum
|
|
408
|
+
- `--ipv6-api` argument
|
|
409
|
+
### Changed
|
|
410
|
+
- Test system modified
|
|
411
|
+
- `README.md` updated
|
|
272
412
|
## [0.4] - 2025-06-09
|
|
273
413
|
### Added
|
|
274
414
|
- Support [ipapi.co](https://ipapi.co/json/)
|
|
@@ -328,7 +468,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
328
468
|
- `--no-geo` argument
|
|
329
469
|
- Logo
|
|
330
470
|
|
|
331
|
-
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.
|
|
471
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.6...dev
|
|
472
|
+
[0.6]: https://github.com/openscilab/ipspot/compare/v0.5...v0.6
|
|
473
|
+
[0.5]: https://github.com/openscilab/ipspot/compare/v0.4...v0.5
|
|
332
474
|
[0.4]: https://github.com/openscilab/ipspot/compare/v0.3...v0.4
|
|
333
475
|
[0.3]: https://github.com/openscilab/ipspot/compare/v0.2...v0.3
|
|
334
476
|
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<img src="https://github.com/openscilab/ipspot/raw/main/otherfiles/logo.png" width="350">
|
|
3
3
|
<h1>IPSpot: A Python Tool to Fetch the System's IP Address</h1>
|
|
4
4
|
<br/>
|
|
5
|
+
<a href="https://codecov.io/gh/openscilab/ipspot"><img src="https://codecov.io/gh/openscilab/ipspot/graph/badge.svg?token=XCFKASULS8"></a>
|
|
5
6
|
<a href="https://badge.fury.io/py/ipspot"><img src="https://badge.fury.io/py/ipspot.svg" alt="PyPI version"></a>
|
|
6
7
|
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
|
|
7
8
|
<a href="https://github.com/openscilab/ipspot"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/ipspot"></a>
|
|
@@ -52,13 +53,13 @@
|
|
|
52
53
|
## Installation
|
|
53
54
|
|
|
54
55
|
### Source Code
|
|
55
|
-
- Download [Version 0.
|
|
56
|
+
- Download [Version 0.6](https://github.com/openscilab/ipspot/archive/v0.6.zip) or [Latest Source](https://github.com/openscilab/ipspot/archive/dev.zip)
|
|
56
57
|
- `pip install .`
|
|
57
58
|
|
|
58
59
|
### PyPI
|
|
59
60
|
|
|
60
61
|
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
61
|
-
- `pip install ipspot==0.
|
|
62
|
+
- `pip install ipspot==0.6`
|
|
62
63
|
|
|
63
64
|
|
|
64
65
|
## Usage
|
|
@@ -85,6 +86,26 @@
|
|
|
85
86
|
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
86
87
|
```
|
|
87
88
|
|
|
89
|
+
#### Public IPv6
|
|
90
|
+
|
|
91
|
+
```pycon
|
|
92
|
+
>>> from ipspot import get_public_ipv6, IPv6API
|
|
93
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB)
|
|
94
|
+
{'data': {'api': 'ip.sb', 'ip': 'xx:xx:xx:xx::xx'}, 'status': True}
|
|
95
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10)
|
|
96
|
+
{'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}
|
|
97
|
+
>>> get_public_ipv6(api=IPv6API.IP_SB, geo=True, timeout=10, max_retries=5, retry_delay=4)
|
|
98
|
+
{'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}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Private IPv6
|
|
102
|
+
|
|
103
|
+
```pycon
|
|
104
|
+
>>> from ipspot import get_private_ipv6
|
|
105
|
+
>>> get_private_ipv6()
|
|
106
|
+
{'status': True, 'data': {'ip': 'fe80::e1bd:f78:b233:21c9'}}
|
|
107
|
+
```
|
|
108
|
+
|
|
88
109
|
### CLI
|
|
89
110
|
|
|
90
111
|
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
@@ -94,7 +115,7 @@
|
|
|
94
115
|
```console
|
|
95
116
|
> ipspot --version
|
|
96
117
|
|
|
97
|
-
0.
|
|
118
|
+
0.6
|
|
98
119
|
```
|
|
99
120
|
|
|
100
121
|
#### Info
|
|
@@ -109,11 +130,11 @@
|
|
|
109
130
|
|___||_| |____/ | .__/ \___/ \__|
|
|
110
131
|
|_|
|
|
111
132
|
|
|
112
|
-
__ __ ___
|
|
113
|
-
\ \ / / _ / _ \
|
|
114
|
-
\ \ / / (_)| | | | |
|
|
115
|
-
\ V / _ | |_| | _ |
|
|
116
|
-
\_/ (_) \___/ (_)
|
|
133
|
+
__ __ ___ __
|
|
134
|
+
\ \ / / _ / _ \ / /_
|
|
135
|
+
\ \ / / (_)| | | | | '_ \
|
|
136
|
+
\ V / _ | |_| | _ | (_) |
|
|
137
|
+
\_/ (_) \___/ (_) \___/
|
|
117
138
|
|
|
118
139
|
|
|
119
140
|
|
|
@@ -131,25 +152,42 @@ Repo : https://github.com/openscilab/ipspot
|
|
|
131
152
|
> ipspot
|
|
132
153
|
Private IP:
|
|
133
154
|
|
|
134
|
-
|
|
155
|
+
IPv4: 192.168.1.35
|
|
156
|
+
|
|
157
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
135
158
|
|
|
136
159
|
Public IP and Location Info:
|
|
137
160
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
IPv4:
|
|
162
|
+
|
|
163
|
+
API: ipinfo.io
|
|
164
|
+
City: Nuremberg
|
|
165
|
+
Country: Germany
|
|
166
|
+
Country Code: DE
|
|
167
|
+
IP: xx.xx.xx.xx
|
|
168
|
+
Latitude: 49.4527
|
|
169
|
+
Longitude: 11.0783
|
|
170
|
+
Organization: Hetzner Online GmbH
|
|
171
|
+
Region: Bavaria
|
|
172
|
+
Timezone: Europe/Berlin
|
|
173
|
+
|
|
174
|
+
IPv6:
|
|
175
|
+
|
|
176
|
+
API: ip.sb
|
|
177
|
+
City: N/A
|
|
178
|
+
Country: Germany
|
|
179
|
+
Country Code: DE
|
|
180
|
+
IP: xx:xx:xx:xx::xx
|
|
181
|
+
Latitude: 51.2993
|
|
182
|
+
Longitude: 9.491
|
|
183
|
+
Organization: Hetzner Online
|
|
184
|
+
Region: N/A
|
|
185
|
+
Timezone: Europe/Berlin
|
|
148
186
|
```
|
|
149
187
|
|
|
150
188
|
#### IPv4 API
|
|
151
189
|
|
|
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`]
|
|
190
|
+
ℹ️ `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
191
|
|
|
154
192
|
ℹ️ The default value: `auto-safe`
|
|
155
193
|
|
|
@@ -157,20 +195,80 @@ Public IP and Location Info:
|
|
|
157
195
|
> ipspot --ipv4-api="ipinfo.io"
|
|
158
196
|
Private IP:
|
|
159
197
|
|
|
160
|
-
|
|
198
|
+
IPv4: 192.168.1.35
|
|
199
|
+
|
|
200
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
161
201
|
|
|
162
202
|
Public IP and Location Info:
|
|
163
203
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
204
|
+
IPv4:
|
|
205
|
+
|
|
206
|
+
API: ipinfo.io
|
|
207
|
+
City: Nuremberg
|
|
208
|
+
Country: Germany
|
|
209
|
+
Country Code: DE
|
|
210
|
+
IP: xx.xx.xx.xx
|
|
211
|
+
Latitude: 49.4527
|
|
212
|
+
Longitude: 11.0783
|
|
213
|
+
Organization: Hetzner Online GmbH
|
|
214
|
+
Region: Bavaria
|
|
215
|
+
Timezone: Europe/Berlin
|
|
216
|
+
|
|
217
|
+
IPv6:
|
|
218
|
+
|
|
219
|
+
API: ip.sb
|
|
220
|
+
City: N/A
|
|
221
|
+
Country: Germany
|
|
222
|
+
Country Code: DE
|
|
223
|
+
IP: xx:xx:xx:xx::xx
|
|
224
|
+
Latitude: 51.2993
|
|
225
|
+
Longitude: 9.491
|
|
226
|
+
Organization: Hetzner Online
|
|
227
|
+
Region: N/A
|
|
228
|
+
Timezone: Europe/Berlin
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
#### IPv6 API
|
|
232
|
+
|
|
233
|
+
ℹ️ `ipv6-api` valid choices: [`auto-safe`, `auto`, `ip.sb`, `ident.me`, `tnedi.me`, `ipleak.net`, `my-ip.io`, `ifconfig.co`, `reallyfreegeoip.org`, `myip.la`, `freeipapi.com`]
|
|
234
|
+
|
|
235
|
+
ℹ️ The default value: `auto-safe`
|
|
236
|
+
|
|
237
|
+
```console
|
|
238
|
+
> ipspot --ipv6-api="ip.sb"
|
|
239
|
+
Private IP:
|
|
240
|
+
|
|
241
|
+
IPv4: 192.168.1.35
|
|
242
|
+
|
|
243
|
+
IPv6: fe80::e1bd:f78:b233:21c9
|
|
244
|
+
|
|
245
|
+
Public IP and Location Info:
|
|
246
|
+
|
|
247
|
+
IPv4:
|
|
248
|
+
|
|
249
|
+
API: ipinfo.io
|
|
250
|
+
City: Nuremberg
|
|
251
|
+
Country: Germany
|
|
252
|
+
Country Code: DE
|
|
253
|
+
IP: xx.xx.xx.xx
|
|
254
|
+
Latitude: 49.4527
|
|
255
|
+
Longitude: 11.0783
|
|
256
|
+
Organization: Hetzner Online GmbH
|
|
257
|
+
Region: Bavaria
|
|
258
|
+
Timezone: Europe/Berlin
|
|
259
|
+
|
|
260
|
+
IPv6:
|
|
261
|
+
|
|
262
|
+
API: ip.sb
|
|
263
|
+
City: N/A
|
|
264
|
+
Country: Germany
|
|
265
|
+
Country Code: DE
|
|
266
|
+
IP: xx:xx:xx:xx::xx
|
|
267
|
+
Latitude: 51.2993
|
|
268
|
+
Longitude: 9.491
|
|
269
|
+
Organization: Hetzner Online
|
|
270
|
+
Region: N/A
|
|
271
|
+
Timezone: Europe/Berlin
|
|
174
272
|
```
|
|
175
273
|
|
|
176
274
|
#### No Geolocation
|
|
@@ -179,12 +277,21 @@ Public IP and Location Info:
|
|
|
179
277
|
> ipspot --no-geo
|
|
180
278
|
Private IP:
|
|
181
279
|
|
|
182
|
-
|
|
280
|
+
IPv4: 192.168.1.35
|
|
281
|
+
|
|
282
|
+
IPv6: fe80::5c40:769f:22de:c196
|
|
183
283
|
|
|
184
284
|
Public IP:
|
|
185
285
|
|
|
186
|
-
|
|
187
|
-
|
|
286
|
+
IPv4:
|
|
287
|
+
|
|
288
|
+
API: tnedi.me
|
|
289
|
+
IP: xx.xx.xx.xx
|
|
290
|
+
|
|
291
|
+
IPv6:
|
|
292
|
+
|
|
293
|
+
API: ip.sb
|
|
294
|
+
IP: xx:xx:xx:xx::xx
|
|
188
295
|
```
|
|
189
296
|
|
|
190
297
|
## 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
|