IPSpot is a Python library for retrieving the current system's IP address and location information. It currently supports public and private IPv4 detection using multiple API providers with a fallback mechanism for reliability. Designed with simplicity and modularity in mind, IPSpot offers quick IP and geolocation lookups directly from your machine.
PyPI Counter | |
Github Stars |
Branch | main | dev |
CI |
- Download Version 0.1 or Latest Source
pip install .
- Check Python Packaging User Guide
pip install ipspot==0.1
>>> from ipspot import get_public_ipv4, IPv4API
>>> get_public_ipv4(api=IPv4API.IPAPI)
{'status': True, 'data': {'ip': 'xx.xx.xx.xx', 'api': 'ip-api.com'}}
>>> get_public_ipv4(api=IPv4API.IPAPI, geo=True)
{'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}
>>> from ipspot import get_private_ipv4
>>> get_private_ipv4()
{'status': True, 'data': {'ip': '10.36.18.154'}}
ℹ️ You can use ipspot
or python -m ipspot
to run this program
> ipspot --version
0.1
> ipspot --info
___ ____ ____ _
|_ _|| _ \ / ___| _ __ ___ | |_
| | | |_) |\___ \ | '_ \ / _ \ | __|
| | | __/ ___) || |_) || (_) || |_
|___||_| |____/ | .__/ \___/ \__|
|_|
__ __ ___ _
\ \ / / _ / _ \ / |
\ \ / / (_)| | | | | |
\ V / _ | |_| | _ | |
\_/ (_) \___/ (_)|_|
IPSpot is a Python library for retrieving the current system's IP address and location information.
It currently supports public and private IPv4 detection using multiple API providers with a fallback mechanism for reliability.
Designed with simplicity and modularity in mind, IPSpot offers quick IP and geolocation lookups directly from your machine.
Repo : https://github.com/openscilab/ipspot
> ipspot
Private IP:
10.36.18.154
Public IP and Location Info:
API: ip-api.com
City: Southampton
Country: United Kingdom
Country Code: GB
IP: xx.xx.xx.xx
Latitude: 50.9097
Longitude: -1.4043
Organization: N/A
Region: England
Timezone: Europe/London
ℹ️ ipv4-api
valid choices: [auto
, ipapi
, ipinfo
]
ℹ️ The default value: auto
> ipspot --ipv4-api="ipinfo"
Private IP:
10.36.18.154
Public IP and Location Info:
API: ipinfo.io
City: Leatherhead
Country: N/A
Country Code: GB
IP: xx.xx.xx.xx
Latitude: 51.2965
Longitude: -0.3338
Organization: AS212238 Datacamp Limited
Region: England
Timezone: Europe/London
> ipspot --no-geo
Private IP:
IP: 10.36.18.154
Public IP:
API: ipinfo.io
IP: xx.xx.xx.xx
Just fill an issue and describe it. We'll check it ASAP!
- Please complete the issue template
Give a ⭐️ if this project helped you!
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 ;-)