Skip to main content

GET IPV4 or IPV6 info

PyPI version License: MIT

兼容环境

Windows/Linux/MacOs


1 安装

pip 安装

$ pip install ip_info_all

源码安装

 $ git clone https://github.com/landybird/IPInfo.git
 $ cd ip_info_all
 $ python setup.py install

2 使用

1 initial a IPInfo object 实例化IP对象

ip_info = IPInfo()

2 get all IPV4 or IPV6 info -- return value is a dict 获取所有的信息

ip4_info_dict = ip_info.all_ipv4_ip_info_dict

# {'em1': IPInfo(addr='10.0.0.206', netmask='10.0.0.206', broadcast='10.0.0.206'),
#  'lo': IPInfo(addr='127.0.0.1', netmask='127.0.0.1', broadcast='127.0.0.1')}


ip6_info_dict = ip_info.all_ipv6_ip_info_dict

...

3 get ip address ,netmask, broadcast info by link encap and param = "addr" or "netmask" or "broadcast" default is address 根据连接节点 获取指定的ip信息

addr, netmask, broadcast = ip_info.get_ipv4_ip_by_encap("lo", param="all")
# '127.0.0.1', '127.0.0.1', '127.0.0.1'

addr = ip_info.get_ipv4_ip_by_encap("lo", param="addr")
# 127.0.0.1

...

License

MIT ©landybird

Release files for ip-info-all 0.0.5

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

Source distribution (sdist)

Source distribution for ip-info-all 0.0.5
File Size Uploaded
ip_info_all-0.0.5.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ip-info-all 0.0.5
File Interpreter ABI Platform
ip_info_all-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / ip_info_all-0.0.5.tar.gz

Download URL ip_info_all-0.0.5.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2aa11f179ea3a87bea0ed0ff194dc26126c2321342068687e07b83c18ee343f3
BLAKE2b-256 checksum
How to use checksums
90516939afb3a55ca7b2210aa417a4025edd375b072d18aa41497cf5ad79944c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release files / ip_info_all-0.0.5-py3-none-any.whl

Download URL ip_info_all-0.0.5-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d5c531429e83921f5d9bcf4f2024fcae5add5e5e45649cb4728f20a09ccbf35
BLAKE2b-256 checksum
How to use checksums
2a581dac153ddfbffadca920c9912d75310b441816d7a02dbeb67cf002f909af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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