Skip to main content

Connected network devices using DBus

Project description

DBus Network Devices

PyPI Python versions License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbus_networkdevices-2024.7.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

dbus_networkdevices-2024.7.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file dbus_networkdevices-2024.7.0.tar.gz.

File metadata

File hashes

Hashes for dbus_networkdevices-2024.7.0.tar.gz
Algorithm Hash digest
SHA256 2c2cd4df3919f9fa0b167b382a45ccc69e58620a12192202a47ba2a18a6f9171
MD5 4519f0a9ac7292233c2f36f83d520d9d
BLAKE2b-256 7ff894a99e2095119f5b16dcb702b58d40f0415c9f82173793b739a6cf198d83

See more details on using hashes here.

File details

Details for the file dbus_networkdevices-2024.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dbus_networkdevices-2024.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9736b1d09003036c4e218da7ebb27c68e3d076fa25b4025c2ca29c6954b91b33
MD5 8604f44e3c7bb184e41fac0fa5414b88
BLAKE2b-256 f8134fa74deb89200cc91d44c1173c1046ae4f84445e9e60b444dcd3546968a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page