Uses ctypes to get the IP configuration
Project description
Uses ctypes to get the IP configuration
pip install ipinfooo
Tested against Windows 10 / Python 3.10 / Anaconda
I haven't written a single line of this code, and I don't know who wrote it. But I know that it is pretty useful if you need details about your network connection - Mozilla Public License, v. 2.0.
From the source code:
# For the sake of humanity here's a python script retrieving
# ip information of the network interfaces.
#
# Pay some tribute to my soul cause I lost a few years on this one
#
# based on code from jaraco and many other attempts
# on internet.
# Fixed by <@gpotter2> from scapy's implementation to
# add IPv6 support + fix structures
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.\
#
from ipinfooo import get_win_ifaddrs
get_win_ifaddrs()
Out[4]:
[{'Realtek Gaming GbE Family Controller': {2: {'addr': 'xxx',
'netmask': 'xxx',
'broadcast': 'xx255',
'network': '1xxxx0'}}},
{'VirtualBox Host-Only Ethernet Adapter': {2: {'addr': '192.168.56.1',
'netmask': '255.255.255.0',
'broadcast': '192.168.56.255',
'network': '192.168.56.0'},
23: {'addr': 'xxxx',
'netmask': 'ffff:ffff:ffff:ffff::',
'broadcast': 'fe80::ffff:ffff:ffff:ffff',
'network': 'fe80::'}}},
{'Software Loopback Interface 1': {2: {'addr': '127.0.0.1',
'netmask': '255.0.0.0',
'broadcast': '127.255.255.255',
'network': '127.0.0.0'},
23: {'addr': '::1',
'netmask': 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
'broadcast': '::1',
'network': '::1'}}}]
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
ipinfooo-0.10.tar.gz
(11.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ipinfooo-0.10-py3-none-any.whl
(12.5 kB
view details)
File details
Details for the file ipinfooo-0.10.tar.gz.
File metadata
- Download URL: ipinfooo-0.10.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99133fbfea163deda0f35e1277d23ef0e3ea3978450f3b650c1f2fa29ce2d811
|
|
| MD5 |
e83867dbf1591c5bae95a89591722548
|
|
| BLAKE2b-256 |
2a8b95631e818e61eb48fff7b1e283e3705a2aeeddd2275a80f8fce5fa7bd5d3
|
File details
Details for the file ipinfooo-0.10-py3-none-any.whl.
File metadata
- Download URL: ipinfooo-0.10-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c59bdb006fba81067b98afcc74f1b8cc8e724d8b3ecbb3c6d7abab237029dc58
|
|
| MD5 |
8f8d8fda2d76b9b53fdfd1eb60f2c590
|
|
| BLAKE2b-256 |
df89e45b2dbbc9b262c22c82944c29b8dd5854aa610e740c808272f8f90e397e
|