get IPV4 or IPV6 info
Project description
GET IPV4 or IPV6 info
兼容环境
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
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信息
ip_info.get_ipv6_ip_by_encap("etho1", param="all")
ip_info.get_ipv6_ip_by_encap("etho1", param="addr")
ip_info.get_ipv4_ip_by_encap("etho1", param="all")
ip_info.get_ipv4_ip_by_encap("etho1", param="addr")
License
MIT ©landybird
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
ip_info_all-0.0.1.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for ip_info_all-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20cd4af53681c5d0c604ade887d589d11b7978cb55972bd55352c6f0f3af9cb1 |
|
MD5 | 2de163c1040f9f84cfbc1c3ea7f95836 |
|
BLAKE2b-256 | 2a4dd49f79538987e7cc47be244e7cafbc24d279ef4bb40123dc491b302be963 |