No project description provided
Project description
netifaces (2)
1. What is this?
The original netifaces was abandonned by it's maintainer, leaving us without the option to get network addresses of any kind in Python. Unfortunately, the original sources are more akin to arcane magic, so picking where it's been left off is a difficult task.
I decided to rewrite netifaces
, keeping the almost exact same API but adding the following:
- Support for future python versions
- Type annotations
- Maybe a more "queriable" API in the future
This project aims to be a drop-in replacement for those project who use netifaces
, but I do not
guarantee anything.
1.1 What is not working right-now
- The
gateways
API is only working if your system has a/proc/net/route
file - The
windows
API is non-functional
The following section is taken from the origin netifaces:
2. Usage
For now the API is the same as the original netifaces
, so please refer to it.
Install:
pip install netifaces2
Import:
>>> import netifaces
>>> netifaces.interfaces()
...
>>> netifaces.ifaddresses('en0')
...
>>> netifacs.gateways()
...
3. API differences between this and al45tair/netifaces
gateways
The gateways
function does not support indexing through the default
special key. This is because it makes a
sane typing definition difficult to write and be understandable. Instead, if you want the same functionality,
the following is exposed:
>>> netifaces.default_gateway()
...
The result will be the default gateway for each interface type. The result may be an empty dict if no default route is set.
4. Platform support
For now, I target Linux and MacOS, with Windows support expected in version >=2.0.0. The minimum python
version you can use is Python 3.5. The linux target for python is manylinux2014
.
5. License
This software is distributed under a 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 Distributions
Hashes for netifaces2-0.0.12-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10ddeb8199daa2fcc33545d92cdeaa2ba69d7dbfa0f5ea5a868f18715dd598a1 |
|
MD5 | c8ea8aa907b0647e3bb396ff4be60a65 |
|
BLAKE2b-256 | ae5eb9f6bdd05b58b0c89fb78ff7a6fdb818737c88f1e8a0e1d960121c49db98 |
Hashes for netifaces2-0.0.12-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d25db4c9aedc12e97ba6dab2108d2cacb9d4fde33bb806ff77d4b26c732b781a |
|
MD5 | 43718568baeaf7cd12726c606068143d |
|
BLAKE2b-256 | 4e7960ca7415c5f0694a3ba76bbc763878669a7837298dc6595252ede2a9cc87 |
Hashes for netifaces2-0.0.12-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe3d6604e6d5d72770686545ac489a033d980b364ec24a4c63287502cfc6c69a |
|
MD5 | 11d6084daf68ec00291a59dc66c29d73 |
|
BLAKE2b-256 | 83c38491521950cfe16aa01276454aba51178c483b111ba634837d67467ae105 |
Hashes for netifaces2-0.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 893ed69a640f56cf4f0ef5b03ac0eb516e460559fc4b10bc84eb7c5920ba19bd |
|
MD5 | 466275504c15c4b0139c687903876504 |
|
BLAKE2b-256 | 2fd1ae0140d5d88c60a8c20b5211f28d15fecae75ab42c26b1249a222aa7c9b0 |
Hashes for netifaces2-0.0.12-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f39e1ca5a861e0966d360f0eb89bf9599f1c69f3d1909be054f39c0eb459248 |
|
MD5 | 855b854cd7774e231a357c2541254311 |
|
BLAKE2b-256 | 0ccc5ad07946abdfce69e256c5a3cba7f3bd01826d4311a1eccc42d4b9afb264 |
Hashes for netifaces2-0.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb55b1feb79108fd102f361d5c04ada16bce5169c26456066fe5ec9ff2fbca62 |
|
MD5 | ef289b9661c42a7ebcd988bd3320c56f |
|
BLAKE2b-256 | c92cfcd1f1e86bdcd89e436a5d8626a5c44d5db8db76436a7201a97019ee33de |
Hashes for netifaces2-0.0.12-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68150f1fb5f8ca8768519de65c8f2d4de95d862d7659900c23af540eb35be0aa |
|
MD5 | e42c6ea17ece64cfec2117bd11720843 |
|
BLAKE2b-256 | b9d470f04de31402de5eafad6435e2b0d7d22a660e1b186639f88ce87b400843 |
Hashes for netifaces2-0.0.12-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dbdb9f8d4d1195c14f871a07d017c90ea801f439e5d572787116c166ee91a92 |
|
MD5 | cb6414242489bb5ceb0afd982f332582 |
|
BLAKE2b-256 | f8f802efdafe516a5a58f1798f4095f7e6ef442b2944dd2dc72ad0f031904e19 |
Hashes for netifaces2-0.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d61cb6099fa985ed6d1b761de530a40fd83e9d4de3f1848c11b73f2d9cf6a1 |
|
MD5 | de573ceeaee44932f3bd1f25c0ab06eb |
|
BLAKE2b-256 | cb8af1d5d4e5161dff9d6c1449abf1e72a81deac8d96a494e3db41180472e52f |
Hashes for netifaces2-0.0.12-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92496ca266cbb87b807eb41044b6c42e2bdc16948b552f0764a7c4674fdb8052 |
|
MD5 | 818414b4937117d4c6e19cd0bff0a0db |
|
BLAKE2b-256 | 1c27bd0573f34ab9b683bb865ede7d8329b604906a9c58cfe53587aedf3ff320 |
Hashes for netifaces2-0.0.12-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbd90b1953fd016c6e783b7f94b05a88619beaa5e692cda983cf89803b060b76 |
|
MD5 | dcaa710a00fa841dcda3ea0c51db4de6 |
|
BLAKE2b-256 | a8cece8700e2f2aad86c4d315a0121f98e2e57de6eb71a59d56bb36a21f6ada1 |
Hashes for netifaces2-0.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd2a025a9b7e60caddd760655077721dad42233cd8cdf828effed8b4b8e99d7 |
|
MD5 | 1a390673eefc7fcbedb498ba89b0c700 |
|
BLAKE2b-256 | aa7358a770398529a161ea19aa3d543e94efff6709b61e44fe7a9cf4590f30d1 |
Hashes for netifaces2-0.0.12-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7c8ce46ba863a229feef65430553968b967fc6fd8650450ef5871b1998b5e41 |
|
MD5 | 10e285d203527a99623a0d16431a1dc3 |
|
BLAKE2b-256 | 833ef4aadfb28955679f0910c30eff54a9553c864fbe4dc95db954d9d959364e |
Hashes for netifaces2-0.0.12-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b959df3f6d43f43c9fc406fb176a49e721acd883518fd7d8d7ea35a424f957be |
|
MD5 | 75b138a899c79973a20ad9260b08a005 |
|
BLAKE2b-256 | b585e1114132186e781660ba5b3aafa56a98323950939eb78c7fa83dc6678be4 |
Hashes for netifaces2-0.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c34a8322b2150fabc67ab8cb3c56d6363284da16301ce72632c833ece2bad24 |
|
MD5 | b73137af565f225d7f65a4358a1c553f |
|
BLAKE2b-256 | 535f3971b93fd666063ff4ba05eb992f84b385177f085aa7022043213cf903bc |
Hashes for netifaces2-0.0.12-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2db844fa316b15f3ad4c795e0e068cbc31b8fa2fc894b87c52c2b6c2f31297 |
|
MD5 | 264e1735a7cc27aa5240c38085a506eb |
|
BLAKE2b-256 | b4772ffbc65eb22adca07d5f3c41cf69bc356f8f1ab2aa6de552274f279b90f4 |