Skip to main content

script to get the public IP (v4) of a PC

Project description

script to get the public IP (v4) of a PC

Tested against Windows 10 / Python 3.10 / Anaconda - should work on MacOS / Linux

pip install getpublicipv4

from getpublicipv4 import get_ip_of_this_pc, doiploop
print(get_ip_of_this_pc())

# Added 
doiploop(*args, **kwargs):
    r"""
    This function takes in variable positional and keyword arguments, and it retrieves
    the WAN IP address of the current PC.
    It also allows for a loop timeout (looptimeout) to be specified.
    The function returns the WAN IP address if it is found, and returns None if a
    timeout occurs or an exception is encountered.
    kwargs are passed to requests.get()

    print(doiploop())
    print(
        doiploop(
            proxies={
                "https": "socks5://111.113.119.110:53681",
                "http": "socks5://111.113.119.110:53681",
            }
        )
    )
    """

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

getpublicipv4-0.12.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

getpublicipv4-0.12-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file getpublicipv4-0.12.tar.gz.

File metadata

  • Download URL: getpublicipv4-0.12.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for getpublicipv4-0.12.tar.gz
Algorithm Hash digest
SHA256 e3747c0c5e4e8aecb954203e0fb98ea1f06342ec3ac322431df352fc42cbc1a4
MD5 7d18a53ec97f955693c5dee8f56b8865
BLAKE2b-256 4a6bc82271130734aecb870a3b7b58e60006f524729f82fab342d5a9209a5bea

See more details on using hashes here.

File details

Details for the file getpublicipv4-0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for getpublicipv4-0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6439f5e75c4ecc71a3cd1470a798492b3ec36270f65fd0ad854b1c9806661113
MD5 3d93f1724b2551a6536c0e8c261baab0
BLAKE2b-256 6522185bff0d7d314ba56a3f562c50f9295f8291f143fafda7254c4be8a7731d

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