Metadata-Version: 2.1
Name: publicaddr
Version: 0.1.0
Summary: Getting your public IP v4 and v6
Home-page: https://github.com/dmachard/python-publicaddr
Author: Denis MACHARD
Author-email: d.machard@gmail.com
Keywords: public ip dns http google akamai opendns cloudflare
Platform: any
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
License-File: LICENSE

# Intro

![Testing](https://github.com/dmachard/python-publicaddr/workflows/Testing/badge.svg) ![Build](https://github.com/dmachard/python-publicaddr/workflows/Build/badge.svg) ![Publish](https://github.com/dmachard/python-publicaddr/workflows/Publish%20to%20PyPI/badge.svg) 

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/publicaddr)

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](https://pypi.org/project/python_publicaddr/) website

```bash
pip install publicaddr
```

## Usage

```python
import publicaddr

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

## Provider

```python
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

```bash
python3 -m unittest -v discover tests/
```
