ipspot 0.0.0__tar.gz → 0.2__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.2/AUTHORS.md +11 -0
- ipspot-0.2/CHANGELOG.md +32 -0
- ipspot-0.2/LICENSE +21 -0
- ipspot-0.2/MANIFEST.in +6 -0
- ipspot-0.2/PKG-INFO +294 -0
- ipspot-0.2/README.md +211 -0
- ipspot-0.2/SECURITY.md +14 -0
- ipspot-0.2/dev-requirements.txt +8 -0
- ipspot-0.2/ipspot/__init__.py +5 -0
- ipspot-0.2/ipspot/__main__.py +7 -0
- ipspot-0.2/ipspot/functions.py +218 -0
- ipspot-0.2/ipspot/params.py +41 -0
- ipspot-0.2/ipspot.egg-info/PKG-INFO +294 -0
- ipspot-0.2/ipspot.egg-info/SOURCES.txt +21 -0
- ipspot-0.2/ipspot.egg-info/entry_points.txt +2 -0
- ipspot-0.2/ipspot.egg-info/requires.txt +2 -0
- ipspot-0.2/requirements.txt +3 -0
- {ipspot-0.0.0 → ipspot-0.2}/setup.cfg +4 -4
- ipspot-0.2/setup.py +75 -0
- ipspot-0.2/tests/test_functions.py +24 -0
- ipspot-0.2/tests/test_ipv4.py +108 -0
- ipspot-0.0.0/PKG-INFO +0 -23
- ipspot-0.0.0/ipspot/__init__.py +0 -2
- ipspot-0.0.0/ipspot.egg-info/PKG-INFO +0 -23
- ipspot-0.0.0/ipspot.egg-info/SOURCES.txt +0 -6
- ipspot-0.0.0/ipspot_setup.py +0 -43
- {ipspot-0.0.0 → ipspot-0.2}/ipspot.egg-info/dependency_links.txt +0 -0
- {ipspot-0.0.0 → ipspot-0.2}/ipspot.egg-info/top_level.txt +0 -0
ipspot-0.2/AUTHORS.md
ADDED
ipspot-0.2/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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.2] - 2025-05-04
|
|
9
|
+
### Added
|
|
10
|
+
- Support [ip.sb](https://api.ip.sb/geoip)
|
|
11
|
+
- `--timeout` argument
|
|
12
|
+
### Changed
|
|
13
|
+
- `README.md` updated
|
|
14
|
+
- Requests header updated
|
|
15
|
+
- Test system modified
|
|
16
|
+
## [0.1] - 2025-04-25
|
|
17
|
+
### Added
|
|
18
|
+
- Support [ipinfo.io](https://ipinfo.io)
|
|
19
|
+
- Support [ip-api.com](https://ip-api.com)
|
|
20
|
+
- `get_private_ipv4` function
|
|
21
|
+
- `get_public_ipv4` function
|
|
22
|
+
- `--info` and `--version` arguments
|
|
23
|
+
- `--ipv4-api` argument
|
|
24
|
+
- `--no-geo` argument
|
|
25
|
+
- Logo
|
|
26
|
+
|
|
27
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.2...dev
|
|
28
|
+
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
29
|
+
[0.1]: https://github.com/openscilab/ipspot/compare/3216fb7...v0.1
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
ipspot-0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 OpenSciLab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ipspot-0.2/MANIFEST.in
ADDED
ipspot-0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ipspot
|
|
3
|
+
Version: 0.2
|
|
4
|
+
Summary: IPSpot: A Python Tool to Fetch the System's IP Address
|
|
5
|
+
Home-page: https://github.com/openscilab/ipspot
|
|
6
|
+
Download-URL: https://github.com/openscilab/ipspot/tarball/v0.2
|
|
7
|
+
Author: IPSpot Development Team
|
|
8
|
+
Author-email: ipspot@openscilab.com
|
|
9
|
+
License: MIT
|
|
10
|
+
Project-URL: Source, https://github.com/openscilab/ipspot
|
|
11
|
+
Keywords: ip ipv4 geo geolocation network location ipspot cli
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Natural Language :: English
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Intended Audience :: Developers
|
|
24
|
+
Classifier: Intended Audience :: Education
|
|
25
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
26
|
+
Classifier: Topic :: System :: Monitoring
|
|
27
|
+
Classifier: Topic :: System :: Networking :: Monitoring
|
|
28
|
+
Classifier: Topic :: Utilities
|
|
29
|
+
Requires-Python: >=3.7
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
License-File: AUTHORS.md
|
|
33
|
+
Requires-Dist: art>=5.3
|
|
34
|
+
Requires-Dist: requests>=2.20.0
|
|
35
|
+
Dynamic: author
|
|
36
|
+
Dynamic: author-email
|
|
37
|
+
Dynamic: classifier
|
|
38
|
+
Dynamic: description
|
|
39
|
+
Dynamic: description-content-type
|
|
40
|
+
Dynamic: download-url
|
|
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
|
+
Dynamic: summary
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
<div align="center">
|
|
52
|
+
<img src="https://github.com/openscilab/ipspot/raw/main/otherfiles/logo.png" width="350">
|
|
53
|
+
<h1>IPSpot: A Python Tool to Fetch the System's IP Address</h1>
|
|
54
|
+
<br/>
|
|
55
|
+
<a href="https://badge.fury.io/py/ipspot"><img src="https://badge.fury.io/py/ipspot.svg" alt="PyPI version"></a>
|
|
56
|
+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
|
|
57
|
+
<a href="https://github.com/openscilab/ipspot"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/ipspot"></a>
|
|
58
|
+
<a href="https://discord.gg/yyDV3T4cwU"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
## Overview
|
|
62
|
+
|
|
63
|
+
<p align="justify">
|
|
64
|
+
<b>IPSpot</b> is a Python library for retrieving the current system's IP address and location information. It currently supports public and private <b>IPv4</b> detection using multiple API providers with a fallback mechanism for reliability. Designed with simplicity and modularity in mind, <b>IPSpot</b> offers quick IP and geolocation lookups directly from your machine.
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
<table>
|
|
68
|
+
<tr>
|
|
69
|
+
<td align="center">PyPI Counter</td>
|
|
70
|
+
<td align="center"><a href="http://pepy.tech/project/ipspot"><img src="http://pepy.tech/badge/ipspot"></a></td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td align="center">Github Stars</td>
|
|
74
|
+
<td align="center"><a href="https://github.com/openscilab/ipspot"><img src="https://img.shields.io/github/stars/openscilab/ipspot.svg?style=social&label=Stars"></a></td>
|
|
75
|
+
</tr>
|
|
76
|
+
</table>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<table>
|
|
81
|
+
<tr>
|
|
82
|
+
<td align="center">Branch</td>
|
|
83
|
+
<td align="center">main</td>
|
|
84
|
+
<td align="center">dev</td>
|
|
85
|
+
</tr>
|
|
86
|
+
<tr>
|
|
87
|
+
<td align="center">CI</td>
|
|
88
|
+
<td align="center"><img src="https://github.com/openscilab/ipspot/actions/workflows/test.yml/badge.svg?branch=main"></td>
|
|
89
|
+
<td align="center"><img src="https://github.com/openscilab/ipspot/actions/workflows/test.yml/badge.svg?branch=dev"></td>
|
|
90
|
+
</tr>
|
|
91
|
+
</table>
|
|
92
|
+
|
|
93
|
+
<table>
|
|
94
|
+
<tr>
|
|
95
|
+
<td align="center">Code Quality</td>
|
|
96
|
+
<td align="center"><a href="https://app.codacy.com/gh/openscilab/ipspot/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/cb2ab6584eb443b8a33da4d4252480bc"/></a></td>
|
|
97
|
+
<td align="center"><a href="https://www.codefactor.io/repository/github/openscilab/ipspot"><img src="https://www.codefactor.io/repository/github/openscilab/ipspot/badge" alt="CodeFactor"></a></td>
|
|
98
|
+
</tr>
|
|
99
|
+
</table>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## Installation
|
|
103
|
+
|
|
104
|
+
### Source Code
|
|
105
|
+
- Download [Version 0.2](https://github.com/openscilab/ipspot/archive/v0.2.zip) or [Latest Source](https://github.com/openscilab/ipspot/archive/dev.zip)
|
|
106
|
+
- `pip install .`
|
|
107
|
+
|
|
108
|
+
### PyPI
|
|
109
|
+
|
|
110
|
+
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
111
|
+
- `pip install ipspot==0.2`
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## Usage
|
|
115
|
+
|
|
116
|
+
### Library
|
|
117
|
+
|
|
118
|
+
#### Public IPv4
|
|
119
|
+
|
|
120
|
+
```pycon
|
|
121
|
+
>>> from ipspot import get_public_ipv4, IPv4API
|
|
122
|
+
>>> get_public_ipv4(api=IPv4API.IPAPI)
|
|
123
|
+
{'status': True, 'data': {'ip': 'xx.xx.xx.xx', 'api': 'ip-api.com'}}
|
|
124
|
+
>>> get_public_ipv4(api=IPv4API.IPAPI, 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
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Private IPv4
|
|
129
|
+
|
|
130
|
+
```pycon
|
|
131
|
+
>>> from ipspot import get_private_ipv4
|
|
132
|
+
>>> get_private_ipv4()
|
|
133
|
+
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### CLI
|
|
137
|
+
|
|
138
|
+
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
139
|
+
|
|
140
|
+
#### Version
|
|
141
|
+
|
|
142
|
+
```console
|
|
143
|
+
> ipspot --version
|
|
144
|
+
|
|
145
|
+
0.2
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### Info
|
|
149
|
+
|
|
150
|
+
```console
|
|
151
|
+
> ipspot --info
|
|
152
|
+
|
|
153
|
+
___ ____ ____ _
|
|
154
|
+
|_ _|| _ \ / ___| _ __ ___ | |_
|
|
155
|
+
| | | |_) |\___ \ | '_ \ / _ \ | __|
|
|
156
|
+
| | | __/ ___) || |_) || (_) || |_
|
|
157
|
+
|___||_| |____/ | .__/ \___/ \__|
|
|
158
|
+
|_|
|
|
159
|
+
|
|
160
|
+
__ __ ___ ____
|
|
161
|
+
\ \ / / _ / _ \ |___ \
|
|
162
|
+
\ \ / / (_)| | | | __) |
|
|
163
|
+
\ V / _ | |_| | _ / __/
|
|
164
|
+
\_/ (_) \___/ (_)|_____|
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
IPSpot is a Python library for retrieving the current system's IP address and location information.
|
|
169
|
+
It currently supports public and private IPv4 detection using multiple API providers with a fallback mechanism for reliability.
|
|
170
|
+
Designed with simplicity and modularity in mind, IPSpot offers quick IP and geolocation lookups directly from your machine.
|
|
171
|
+
|
|
172
|
+
Repo : https://github.com/openscilab/ipspot
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### Basic
|
|
177
|
+
|
|
178
|
+
```console
|
|
179
|
+
> ipspot
|
|
180
|
+
Private IP:
|
|
181
|
+
|
|
182
|
+
10.36.18.154
|
|
183
|
+
|
|
184
|
+
Public IP and Location Info:
|
|
185
|
+
|
|
186
|
+
API: ip-api.com
|
|
187
|
+
City: Southampton
|
|
188
|
+
Country: United Kingdom
|
|
189
|
+
Country Code: GB
|
|
190
|
+
IP: xx.xx.xx.xx
|
|
191
|
+
Latitude: 50.9097
|
|
192
|
+
Longitude: -1.4043
|
|
193
|
+
Organization: N/A
|
|
194
|
+
Region: England
|
|
195
|
+
Timezone: Europe/London
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
#### IPv4 API
|
|
199
|
+
|
|
200
|
+
ℹ️ `ipv4-api` valid choices: [`auto`, `ipapi`, `ipinfo`, `ipsb`]
|
|
201
|
+
|
|
202
|
+
ℹ️ The default value: `auto`
|
|
203
|
+
|
|
204
|
+
```console
|
|
205
|
+
> ipspot --ipv4-api="ipinfo"
|
|
206
|
+
Private IP:
|
|
207
|
+
|
|
208
|
+
10.36.18.154
|
|
209
|
+
|
|
210
|
+
Public IP and Location Info:
|
|
211
|
+
|
|
212
|
+
API: ipinfo.io
|
|
213
|
+
City: Leatherhead
|
|
214
|
+
Country: N/A
|
|
215
|
+
Country Code: GB
|
|
216
|
+
IP: xx.xx.xx.xx
|
|
217
|
+
Latitude: 51.2965
|
|
218
|
+
Longitude: -0.3338
|
|
219
|
+
Organization: AS212238 Datacamp Limited
|
|
220
|
+
Region: England
|
|
221
|
+
Timezone: Europe/London
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### No Geolocation
|
|
225
|
+
|
|
226
|
+
```console
|
|
227
|
+
> ipspot --no-geo
|
|
228
|
+
Private IP:
|
|
229
|
+
|
|
230
|
+
IP: 10.36.18.154
|
|
231
|
+
|
|
232
|
+
Public IP:
|
|
233
|
+
|
|
234
|
+
API: ipinfo.io
|
|
235
|
+
IP: xx.xx.xx.xx
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Issues & Bug Reports
|
|
239
|
+
|
|
240
|
+
Just fill an issue and describe it. We'll check it ASAP!
|
|
241
|
+
|
|
242
|
+
- Please complete the issue template
|
|
243
|
+
|
|
244
|
+
You can also join our discord server
|
|
245
|
+
|
|
246
|
+
<a href="https://discord.gg/yyDV3T4cwU">
|
|
247
|
+
<img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
|
|
248
|
+
</a>
|
|
249
|
+
|
|
250
|
+
## Show Your Support
|
|
251
|
+
|
|
252
|
+
<h3>Star This Repo</h3>
|
|
253
|
+
|
|
254
|
+
Give a ⭐️ if this project helped you!
|
|
255
|
+
|
|
256
|
+
<h3>Donate to Our Project</h3>
|
|
257
|
+
|
|
258
|
+
If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-)
|
|
259
|
+
|
|
260
|
+
<a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/ipspot/raw/main/otherfiles/donation.png" height="90px" width="270px" alt="IPSpot Donation"></a>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
# Changelog
|
|
264
|
+
All notable changes to this project will be documented in this file.
|
|
265
|
+
|
|
266
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
267
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
268
|
+
|
|
269
|
+
## [Unreleased]
|
|
270
|
+
## [0.2] - 2025-05-04
|
|
271
|
+
### Added
|
|
272
|
+
- Support [ip.sb](https://api.ip.sb/geoip)
|
|
273
|
+
- `--timeout` argument
|
|
274
|
+
### Changed
|
|
275
|
+
- `README.md` updated
|
|
276
|
+
- Requests header updated
|
|
277
|
+
- Test system modified
|
|
278
|
+
## [0.1] - 2025-04-25
|
|
279
|
+
### Added
|
|
280
|
+
- Support [ipinfo.io](https://ipinfo.io)
|
|
281
|
+
- Support [ip-api.com](https://ip-api.com)
|
|
282
|
+
- `get_private_ipv4` function
|
|
283
|
+
- `get_public_ipv4` function
|
|
284
|
+
- `--info` and `--version` arguments
|
|
285
|
+
- `--ipv4-api` argument
|
|
286
|
+
- `--no-geo` argument
|
|
287
|
+
- Logo
|
|
288
|
+
|
|
289
|
+
[Unreleased]: https://github.com/openscilab/ipspot/compare/v0.2...dev
|
|
290
|
+
[0.2]: https://github.com/openscilab/ipspot/compare/v0.1...v0.2
|
|
291
|
+
[0.1]: https://github.com/openscilab/ipspot/compare/3216fb7...v0.1
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
ipspot-0.2/README.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://github.com/openscilab/ipspot/raw/main/otherfiles/logo.png" width="350">
|
|
3
|
+
<h1>IPSpot: A Python Tool to Fetch the System's IP Address</h1>
|
|
4
|
+
<br/>
|
|
5
|
+
<a href="https://badge.fury.io/py/ipspot"><img src="https://badge.fury.io/py/ipspot.svg" alt="PyPI version"></a>
|
|
6
|
+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
|
|
7
|
+
<a href="https://github.com/openscilab/ipspot"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/ipspot"></a>
|
|
8
|
+
<a href="https://discord.gg/yyDV3T4cwU"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
<p align="justify">
|
|
14
|
+
<b>IPSpot</b> is a Python library for retrieving the current system's IP address and location information. It currently supports public and private <b>IPv4</b> detection using multiple API providers with a fallback mechanism for reliability. Designed with simplicity and modularity in mind, <b>IPSpot</b> offers quick IP and geolocation lookups directly from your machine.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<table>
|
|
18
|
+
<tr>
|
|
19
|
+
<td align="center">PyPI Counter</td>
|
|
20
|
+
<td align="center"><a href="http://pepy.tech/project/ipspot"><img src="http://pepy.tech/badge/ipspot"></a></td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<td align="center">Github Stars</td>
|
|
24
|
+
<td align="center"><a href="https://github.com/openscilab/ipspot"><img src="https://img.shields.io/github/stars/openscilab/ipspot.svg?style=social&label=Stars"></a></td>
|
|
25
|
+
</tr>
|
|
26
|
+
</table>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<table>
|
|
31
|
+
<tr>
|
|
32
|
+
<td align="center">Branch</td>
|
|
33
|
+
<td align="center">main</td>
|
|
34
|
+
<td align="center">dev</td>
|
|
35
|
+
</tr>
|
|
36
|
+
<tr>
|
|
37
|
+
<td align="center">CI</td>
|
|
38
|
+
<td align="center"><img src="https://github.com/openscilab/ipspot/actions/workflows/test.yml/badge.svg?branch=main"></td>
|
|
39
|
+
<td align="center"><img src="https://github.com/openscilab/ipspot/actions/workflows/test.yml/badge.svg?branch=dev"></td>
|
|
40
|
+
</tr>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
<table>
|
|
44
|
+
<tr>
|
|
45
|
+
<td align="center">Code Quality</td>
|
|
46
|
+
<td align="center"><a href="https://app.codacy.com/gh/openscilab/ipspot/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/cb2ab6584eb443b8a33da4d4252480bc"/></a></td>
|
|
47
|
+
<td align="center"><a href="https://www.codefactor.io/repository/github/openscilab/ipspot"><img src="https://www.codefactor.io/repository/github/openscilab/ipspot/badge" alt="CodeFactor"></a></td>
|
|
48
|
+
</tr>
|
|
49
|
+
</table>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
### Source Code
|
|
55
|
+
- Download [Version 0.2](https://github.com/openscilab/ipspot/archive/v0.2.zip) or [Latest Source](https://github.com/openscilab/ipspot/archive/dev.zip)
|
|
56
|
+
- `pip install .`
|
|
57
|
+
|
|
58
|
+
### PyPI
|
|
59
|
+
|
|
60
|
+
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
61
|
+
- `pip install ipspot==0.2`
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
### Library
|
|
67
|
+
|
|
68
|
+
#### Public IPv4
|
|
69
|
+
|
|
70
|
+
```pycon
|
|
71
|
+
>>> from ipspot import get_public_ipv4, IPv4API
|
|
72
|
+
>>> get_public_ipv4(api=IPv4API.IPAPI)
|
|
73
|
+
{'status': True, 'data': {'ip': 'xx.xx.xx.xx', 'api': 'ip-api.com'}}
|
|
74
|
+
>>> get_public_ipv4(api=IPv4API.IPAPI, 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
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Private IPv4
|
|
79
|
+
|
|
80
|
+
```pycon
|
|
81
|
+
>>> from ipspot import get_private_ipv4
|
|
82
|
+
>>> get_private_ipv4()
|
|
83
|
+
{'status': True, 'data': {'ip': '10.36.18.154'}}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### CLI
|
|
87
|
+
|
|
88
|
+
ℹ️ You can use `ipspot` or `python -m ipspot` to run this program
|
|
89
|
+
|
|
90
|
+
#### Version
|
|
91
|
+
|
|
92
|
+
```console
|
|
93
|
+
> ipspot --version
|
|
94
|
+
|
|
95
|
+
0.2
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Info
|
|
99
|
+
|
|
100
|
+
```console
|
|
101
|
+
> ipspot --info
|
|
102
|
+
|
|
103
|
+
___ ____ ____ _
|
|
104
|
+
|_ _|| _ \ / ___| _ __ ___ | |_
|
|
105
|
+
| | | |_) |\___ \ | '_ \ / _ \ | __|
|
|
106
|
+
| | | __/ ___) || |_) || (_) || |_
|
|
107
|
+
|___||_| |____/ | .__/ \___/ \__|
|
|
108
|
+
|_|
|
|
109
|
+
|
|
110
|
+
__ __ ___ ____
|
|
111
|
+
\ \ / / _ / _ \ |___ \
|
|
112
|
+
\ \ / / (_)| | | | __) |
|
|
113
|
+
\ V / _ | |_| | _ / __/
|
|
114
|
+
\_/ (_) \___/ (_)|_____|
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
IPSpot is a Python library for retrieving the current system's IP address and location information.
|
|
119
|
+
It currently supports public and private IPv4 detection using multiple API providers with a fallback mechanism for reliability.
|
|
120
|
+
Designed with simplicity and modularity in mind, IPSpot offers quick IP and geolocation lookups directly from your machine.
|
|
121
|
+
|
|
122
|
+
Repo : https://github.com/openscilab/ipspot
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### Basic
|
|
127
|
+
|
|
128
|
+
```console
|
|
129
|
+
> ipspot
|
|
130
|
+
Private IP:
|
|
131
|
+
|
|
132
|
+
10.36.18.154
|
|
133
|
+
|
|
134
|
+
Public IP and Location Info:
|
|
135
|
+
|
|
136
|
+
API: ip-api.com
|
|
137
|
+
City: Southampton
|
|
138
|
+
Country: United Kingdom
|
|
139
|
+
Country Code: GB
|
|
140
|
+
IP: xx.xx.xx.xx
|
|
141
|
+
Latitude: 50.9097
|
|
142
|
+
Longitude: -1.4043
|
|
143
|
+
Organization: N/A
|
|
144
|
+
Region: England
|
|
145
|
+
Timezone: Europe/London
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### IPv4 API
|
|
149
|
+
|
|
150
|
+
ℹ️ `ipv4-api` valid choices: [`auto`, `ipapi`, `ipinfo`, `ipsb`]
|
|
151
|
+
|
|
152
|
+
ℹ️ The default value: `auto`
|
|
153
|
+
|
|
154
|
+
```console
|
|
155
|
+
> ipspot --ipv4-api="ipinfo"
|
|
156
|
+
Private IP:
|
|
157
|
+
|
|
158
|
+
10.36.18.154
|
|
159
|
+
|
|
160
|
+
Public IP and Location Info:
|
|
161
|
+
|
|
162
|
+
API: ipinfo.io
|
|
163
|
+
City: Leatherhead
|
|
164
|
+
Country: N/A
|
|
165
|
+
Country Code: GB
|
|
166
|
+
IP: xx.xx.xx.xx
|
|
167
|
+
Latitude: 51.2965
|
|
168
|
+
Longitude: -0.3338
|
|
169
|
+
Organization: AS212238 Datacamp Limited
|
|
170
|
+
Region: England
|
|
171
|
+
Timezone: Europe/London
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
#### No Geolocation
|
|
175
|
+
|
|
176
|
+
```console
|
|
177
|
+
> ipspot --no-geo
|
|
178
|
+
Private IP:
|
|
179
|
+
|
|
180
|
+
IP: 10.36.18.154
|
|
181
|
+
|
|
182
|
+
Public IP:
|
|
183
|
+
|
|
184
|
+
API: ipinfo.io
|
|
185
|
+
IP: xx.xx.xx.xx
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Issues & Bug Reports
|
|
189
|
+
|
|
190
|
+
Just fill an issue and describe it. We'll check it ASAP!
|
|
191
|
+
|
|
192
|
+
- Please complete the issue template
|
|
193
|
+
|
|
194
|
+
You can also join our discord server
|
|
195
|
+
|
|
196
|
+
<a href="https://discord.gg/yyDV3T4cwU">
|
|
197
|
+
<img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
|
|
198
|
+
</a>
|
|
199
|
+
|
|
200
|
+
## Show Your Support
|
|
201
|
+
|
|
202
|
+
<h3>Star This Repo</h3>
|
|
203
|
+
|
|
204
|
+
Give a ⭐️ if this project helped you!
|
|
205
|
+
|
|
206
|
+
<h3>Donate to Our Project</h3>
|
|
207
|
+
|
|
208
|
+
If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-)
|
|
209
|
+
|
|
210
|
+
<a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/ipspot/raw/main/otherfiles/donation.png" height="90px" width="270px" alt="IPSpot Donation"></a>
|
|
211
|
+
|
ipspot-0.2/SECURITY.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------------- | ------------------ |
|
|
7
|
+
| 0.2 | :white_check_mark: |
|
|
8
|
+
| < 0.2 | :x: |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
Please report security vulnerabilities by email to [ipspot@openscilab.com](mailto:ipspot@openscilab.com "ipspot@openscilab.com").
|
|
13
|
+
|
|
14
|
+
If the security vulnerability is accepted, a dedicated bugfix release will be issued as soon as possible (depending on the complexity of the fix).
|