Connected network devices using DBus
Project description
DBus Network Devices
The dbus-networkdevices
library empowers Python applications to get the active network devices that are connected to your network.
Key Features
- IP Access: Retrieve interface name, ip addresses, wifi ssid, etc...
- Real-time Updates: Utilizes callback functions to provide instant updates of network changes.
Requirements
- Python 3.7 or later
dasdbus
library
Installation
Install the library using pip:
pip install dbus-networkdevices
Usage
This library offers two primary usage approaches:
Command-Line Interaction
If you prefer a quick way to view information or control playback, you can potentially execute the dbus-networkdevices script directly. For more extensive programmatic control, I would recommend using the library within your Python code.
Programmatic Control
Import the DBUSNetworkDevices class from your Python code:
import json
from dbus_networkdevices import DBUSNetworkDevices
def callback(devices):
# Handle the list of network devices here
print(json.dumps(devices, indent=2))
# Create an instance of the class
DBUSNetworkDevices(callback)
# Keep the app running
while True:
time.sleep(1)
Inspiration
Most python applications use iwgetid
and information from /proc/net/wireless
to get the WiFi status, so I created this library to get the information directly from DBus and also include other interfaces.
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 Distribution
File details
Details for the file dbus_networkdevices-2024.7.0.tar.gz
.
File metadata
- Download URL: dbus_networkdevices-2024.7.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c2cd4df3919f9fa0b167b382a45ccc69e58620a12192202a47ba2a18a6f9171 |
|
MD5 | 4519f0a9ac7292233c2f36f83d520d9d |
|
BLAKE2b-256 | 7ff894a99e2095119f5b16dcb702b58d40f0415c9f82173793b739a6cf198d83 |
File details
Details for the file dbus_networkdevices-2024.7.0-py3-none-any.whl
.
File metadata
- Download URL: dbus_networkdevices-2024.7.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9736b1d09003036c4e218da7ebb27c68e3d076fa25b4025c2ca29c6954b91b33 |
|
MD5 | 8604f44e3c7bb184e41fac0fa5414b88 |
|
BLAKE2b-256 | f8134fa74deb89200cc91d44c1173c1046ae4f84445e9e60b444dcd3546968a7 |