Skip to main content

Getting your public IP v4 and v6

Project description

Intro

Testing Build Publish

License: MIT PyPI - Python Version

Simple python module for getting your public IP V4 and V6 with several providers support. The following one are supported:

  • Google (DNS)
  • Cloudflare (DNS)
  • OpenDNS (DNS)
  • Akamai (HTTP)

Installation

This module can be installed from pypi website

pip install publicaddr

Usage

import publicaddr

publicaddr.getall()
{'ip4': 'x.x.x.x', 'ip6': 'x:x:x:x:x:x:x:x'}

Provider

import publicaddr
from publicaddr import PROVIDER_GOOGLE, PROVIDER_OPENDNS, PROVIDER_CLOUDFLARE, PROVIDER_AKAMAI

publicaddr.getall(PROVIDER_AKAMAI)
{'ip4': 'x.x.x.x', 'ip6': 'x:x:x:x:x:x:x:x'}

For developpers

Run test units

python3 -m unittest -v discover tests/

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

publicaddr-0.1.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

publicaddr-0.1.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

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