Skip to main content

A Python library to fetch public and private IP addresses.

Reason this release was yanked:

Issues with module cli

Project description

IP Fetcher

ip_fetcher is a Python library for retrieving public and private IP addresses, checking IP types, and detecting proxies or VPNs. It also provides a command-line interface (CLI) for ease of use.

Features

  • Fetches Public IP Address: Retrieves the public IP address of the user.
  • Retrieves Private IP Address: Retrieves the private IP address of the user.
  • Checks IP Type: Determines if a given IP address is IPv4 or IPv6.
  • Detects Proxy or VPN: Checks if a given IP address is associated with a known proxy or VPN.
  • Command-Line Interface: Provides a CLI for quick access to the library's functionalities.

Installation

To install the package, use:

pip install ip_fetcher

Usage

Here are some examples of how to use the ip_fetcher library:

Fetching the Public IP

To get your public IP address:

from ip_fetcher import get_public_ip

public_ip = get_public_ip()
print(f"Public IP: {public_ip}")

Fetching the Private IP

To get your private IP address:

from ip_fetcher import get_private_ip

private_ip = get_private_ip()
print(f"Private IP: {private_ip}")

Checking IP Type

To check if an IP address is IPv4 or IPv6:

from ip_fetcher import is_ipv4, is_ipv6

ip_address = "192.168.1.1"

if is_ipv4(ip_address):
    print(f"{ip_address} is an IPv4 address.")
elif is_ipv6(ip_address):
    print(f"{ip_address} is an IPv6 address.")
else:
    print(f"{ip_address} is not a valid IP address.")

Checking for Proxy or VPN

To check if an IP address is associated with a proxy or VPN:

from ip_fetcher import check_ip_proxy_vpn

ip_address = "8.8.8.8"

if check_ip_proxy_vpn(ip_address):
    print(f"{ip_address} is associated with a proxy or VPN.")
else:
    print(f"{ip_address} is not associated with a proxy or VPN.")

Command-Line Interface (CLI)

After installing the package, you can use the command-line interface to access the library's functionalities directly from the terminal.

Fetch Public IP

ip-fetcher --public

Fetch Private IP

ip-fetcher --private

Fetch Both Public and Private IPs

ip-fetcher --public --private

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

ip_fetcher-0.3.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

ip_fetcher-0.3.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file ip_fetcher-0.3.2.tar.gz.

File metadata

  • Download URL: ip_fetcher-0.3.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for ip_fetcher-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9715f3e7ddc48df3ec3d23dba373ab70308a4051b0c53c8d7da34e8d39910cd6
MD5 fd26f24b2f57aa7fbd728a2f24df4a47
BLAKE2b-256 0008727393422ae86ca440bc20b8ad2ed7a0e441cb581e6c8f2fdf202e80fefe

See more details on using hashes here.

File details

Details for the file ip_fetcher-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ip_fetcher-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for ip_fetcher-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc6ddaa064636b99fd9aa41d5dbf4b4bd0e92f3293e434e429a85aa9bb827bec
MD5 d886d692ef991c3d2ccaabea036169e3
BLAKE2b-256 98acf8f2bbf046ef52d4fe95b307ab264744d377304b4d73dee303fcd59d9034

See more details on using hashes here.

Supported by

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