Skip to main content

IPSpot: A Python Tool to Fetch the System's IP Address

Project description

IPSpot: A Python Tool to Fetch the System's IP Address


PyPI version built with Python3 GitHub repo size

Overview

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

Installation

Source Code

PyPI

Usage

Library

Public IPv4

>>> 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}

Private IPv4

>>> from ipspot import get_private_ipv4
>>> get_private_ipv4()
{'status': True, 'data': {'ip': '10.36.18.154'}}

CLI

ℹ️ You can use ipspot or python -m ipspot to run this program

Version

> ipspot --version

0.1

Info

> 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

Basic

> 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

ℹ️ 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

No Geolocation

> ipspot --no-geo
Private IP:

  IP: 10.36.18.154

Public IP:

  API: ipinfo.io
  IP: xx.xx.xx.xx

Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP!

  • Please complete the issue template

Show Your Support

Star This Repo

Give a ⭐️ if this project helped you!

Donate to Our Project

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 ;-)

IPSpot Donation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.1 - 2025-04-25

Added

  • Support ipinfo.io
  • Support ip-api.com
  • get_private_ipv4 function
  • get_public_ipv4 function
  • --info and --version arguments
  • --ipv4-api argument
  • --no-geo argument
  • Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipspot-0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipspot-0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file ipspot-0.1.tar.gz.

File metadata

  • Download URL: ipspot-0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ipspot-0.1.tar.gz
Algorithm Hash digest
SHA256 9f357ed30348c332136b771fcd91244e37f8cf067ba99ecebc23fa9bf55694ca
MD5 c84985affc16f72419434c6b8224cd16
BLAKE2b-256 6fdbf0ca854ae269047400da79346c0dd5c9cdf969cbd9187dc4562c18b7714a

See more details on using hashes here.

File details

Details for the file ipspot-0.1-py3-none-any.whl.

File metadata

  • Download URL: ipspot-0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ipspot-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f739ac6f9560891c9191fe276b4a83035fe18ec5aead9696999ff9229ba65605
MD5 4efa084d97617a478185467fc3d3d063
BLAKE2b-256 d8cae13977f92cf19d2c3842603c180e284486da39cdb5ecd7a2b93861f4e0fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page