Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gle_ip_info-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gle_ip_info-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file gle_ip_info-0.1.1.tar.gz.

File metadata

  • Download URL: gle_ip_info-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for gle_ip_info-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf5588491a4df114741edb173f08a5ff001e04c21e1afa38eaf425f45b7c5f4e
MD5 b11e3bad7ea65c5c87db37140a50fcbe
BLAKE2b-256 d7bffc9a31a3c6beff7f321967022a2d4645b087b910dce2a764461d62ac5954

See more details on using hashes here.

File details

Details for the file gle_ip_info-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gle_ip_info-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for gle_ip_info-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 875d1d41ddaba651292b9aa1f6f7b275f8f9a6ab8773bda019eb4a7fa11caac0
MD5 05bf9013f954e1d6b83d7cb0ced731c2
BLAKE2b-256 35d1823782111bbde092d1bde9fa0d7548fe4e730ebce08c77b2f64c7de389f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page