Skip to main content

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",
            }
        )
    )
    """

Metadata

Release files for getpublicipv4 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getpublicipv4 0.12
File Size Uploaded Provenance Actions
getpublicipv4-0.12.tar.gz 7.2 kB Without provenance Details for getpublicipv4-0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for getpublicipv4 0.12
File Interpreter ABI Platform Actions
getpublicipv4-0.12-py3-none-any.whl Python 3 none any Details for getpublicipv4-0.12-py3-none-any.whl

Total release size: 15.5 kB

Release files / getpublicipv4-0.12.tar.gz

Download URL getpublicipv4-0.12.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e3747c0c5e4e8aecb954203e0fb98ea1f06342ec3ac322431df352fc42cbc1a4
BLAKE2b-256 checksum
How to use checksums
4a6bc82271130734aecb870a3b7b58e60006f524729f82fab342d5a9209a5bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / getpublicipv4-0.12-py3-none-any.whl

Download URL getpublicipv4-0.12-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6439f5e75c4ecc71a3cd1470a798492b3ec36270f65fd0ad854b1c9806661113
BLAKE2b-256 checksum
How to use checksums
6522185bff0d7d314ba56a3f562c50f9295f8291f143fafda7254c4be8a7731d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for getpublicipv4 0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page