Port variant | v12 |
Summary | Portable network interface information (3.12) |
BROKEN | |
Package version | 0.0.22 |
Homepage | https://github.com/SamuelYvon/netifaces-2 |
Keywords | python, rust |
Maintainer | Python Automaton |
License | Not yet specified |
Other variants | v13 |
Ravenports | Buildsheet | History |
Ravensource | Port Directory | History |
Last modified | 11 NOV 2024, 23:28:05 UTC |
Port created | 02 NOV 2024, 22:54:22 UTC |
single | # 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 and 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 or the `ip` tool - The `windows` gateways API is non-functional ## 2. Usage For now the API is the same as the original `netifaces`, so please refer to [it]. Install: `shell pip install netifaces2 ` Import: ```python >>> 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: ```python >>> 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. The level of completness differs a little bit with the original version; some address families might not yet be available and `PEER` addresses are not reported for now. If you need a feature, open an issue and I will do my best to add it. Gateways also returned the interfaces indexed by integer values. This is a bit odd (IMO) since the integers values for the interface types are system-dependent. Enum values with a more semantic meaning are now used (they are still tied to linux numbers), but you can use `old_api=True` in their call to get the al45air-style keys back. ### `AF_` Constants In the previous version of `netifaces` the `AF_` constants' value were assigned to be platform independent. This has the nice effect of abstracting the OS when accessing the information of a network layer. However after consideration, it does not feel like the right place to provide abstraction. If you update your project's dependencies to this version of `netifaces`, be wary of this change. For instance, on linux you may need to replace `AF_LINK` with `AF_PACKET` to get mac addresses. In the future, an extra API will allow accessing a specific layer's |
Build (only) |
python-setuptools-rust:single:v12 python-maturin:single:v12 python-pip:single:v12 rust:single:std python312:dev:std autoselect-python:single:std |
Build and Runtime | python312:primary:std |
Runtime (only) | ravensys-gcc:libs:std (single subpackage) |
main | mirror://PYPI/n/netifaces2 |
cr01 | mirror://CRATES/autocfg:1.1.0 |
cr02 | mirror://CRATES/bitflags:1.3.2 |
cr03 | mirror://CRATES/bitflags:2.4.2 |
cr04 | mirror://CRATES/cfg-if:1.0.0 |
cr05 | mirror://CRATES/cfg_aliases:0.1.1 |
cr06 | mirror://CRATES/indoc:1.0.7 |
cr07 | mirror://CRATES/libc:0.2.153 |
cr08 | mirror://CRATES/lock_api:0.4.9 |
cr09 | mirror://CRATES/log:0.4.20 |
cr10 | mirror://CRATES/memoffset:0.6.5 |
cr11 | mirror://CRATES/memoffset:0.9.0 |
cr12 | mirror://CRATES/nix:0.28.0 |
cr13 | mirror://CRATES/once_cell:1.15.0 |
cr14 | mirror://CRATES/parking_lot:0.12.1 |
cr15 | mirror://CRATES/parking_lot_core:0.9.3 |
cr16 | mirror://CRATES/proc-macro2:1.0.70 |
cr17 | mirror://CRATES/pyo3:0.17.2 |
cr18 | mirror://CRATES/pyo3-build-config:0.17.2 |
cr19 | mirror://CRATES/pyo3-ffi:0.17.2 |
cr20 | mirror://CRATES/pyo3-macros:0.17.2 |
cr21 | mirror://CRATES/pyo3-macros-backend:0.17.2 |
cr22 | mirror://CRATES/quote:1.0.33 |
cr23 | mirror://CRATES/redox_syscall:0.2.16 |
cr24 | mirror://CRATES/scopeguard:1.1.0 |
cr25 | mirror://CRATES/smallvec:1.10.0 |
cr26 | mirror://CRATES/syn:1.0.102 |
cr27 | mirror://CRATES/syn:2.0.41 |
cr28 | mirror://CRATES/target-lexicon:0.12.4 |
cr29 | mirror://CRATES/thiserror:1.0.51 |
cr30 | mirror://CRATES/thiserror-impl:1.0.51 |
cr31 | mirror://CRATES/unicode-ident:1.0.5 |
cr32 | mirror://CRATES/unindent:0.1.10 |
cr33 | mirror://CRATES/windows:0.42.0 |
cr34 | mirror://CRATES/windows-sys:0.36.1 |
cr35 | mirror://CRATES/windows_aarch64_gnullvm:0.42.0 |
cr36 | mirror://CRATES/windows_aarch64_msvc:0.36.1 |
cr37 | mirror://CRATES/windows_aarch64_msvc:0.42.0 |
cr38 | mirror://CRATES/windows_i686_gnu:0.36.1 |
cr39 | mirror://CRATES/windows_i686_gnu:0.42.0 |
cr40 | mirror://CRATES/windows_i686_msvc:0.36.1 |
cr41 | mirror://CRATES/windows_i686_msvc:0.42.0 |
cr42 | mirror://CRATES/windows_x86_64_gnu:0.36.1 |
cr43 | mirror://CRATES/windows_x86_64_gnu:0.42.0 |
cr44 | mirror://CRATES/windows_x86_64_gnullvm:0.42.0 |
cr45 | mirror://CRATES/windows_x86_64_msvc:0.36.1 |
cr46 | mirror://CRATES/windows_x86_64_msvc:0.42.0 |
python-netbox-agent:v12 | NetBox agent for server (3.12) |