Retrieve local, global, external ipaddress.
Project description
gle_ip_info
glip is a module for retrieve ip address like local-ip, global-ip, external-ip as string.
Installation
Run the following to install:
'''python pip install gle_ip_info '''
Usage
''' from gle_ip_info import IP
Ip = IP() # Initialize the IP class
os = Ip.Os # To get your os info.
dev = Ip.devices # Gives connected devices as list.
local_ip = Ip.get_local_ip() # TO get your local ipaddress.
global_ip = Ip.get_global_ip() # To get your global ipaddress.
external_ip = Ip.get_external_ip() # To get external(of connected device) ipaddress, returns the ip address of 1st device '''
How it works
It use's --> ''' --> os module, --> requests module, --> platfrom module, --> upnpclient module.
***Local_IP is collected from the cmd(in Windows) or Bash-Terminal(in Linux) using 'ipconfig'/ 'hostname -I' command.So there is no need to get the hostname like socket module does and the accuracy of the output is 100% in Linux Os.
***Global_IP is collected by sending request to 'https://checkip.amazonaws.com' or 'https://www.wikipedia.org' using python requests module.So to get the global_ip a stable net connection is needed.
***External_IP of any router or alike devices can be collected using upnpclient module. It takes a little more time to get the external_ipaddress Compare to other two functions.Though it don't require stable Internet connection but requires a stable connection between the devices. '''
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gle_ip_info-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 875d1d41ddaba651292b9aa1f6f7b275f8f9a6ab8773bda019eb4a7fa11caac0 |
|
MD5 | 05bf9013f954e1d6b83d7cb0ced731c2 |
|
BLAKE2b-256 | 35d1823782111bbde092d1bde9fa0d7548fe4e730ebce08c77b2f64c7de389f2 |