Output details of hosts on the network found by Linux's avahi mdns server in JSON.
Project description
avahi-json
@readwithai - X - blog - machine-aided reading - 📖⚡️🖋️
Query the local network for devices and services using MDNS bia avahi (like avahi-browser -ar) but output results in easy-to-use JSON.
Motivation
I have an Android phone on my home network. I also KDE connect on the phone. I occassionally want to connect to it via ADB over a TCP connection. But the IP address is not reliable. However, I can use KDE connect to find the device since KDE connect advertises itself using an MDNS services (i.e. avahi). All well and good - but the avahi command-line does not allow the querying I need and does not (really) output machine readable data. I am surprised that no one has written this before.
Therefore I am writing something which queries for services on the network using avahi and outputs theresult in beautiful JSON.
Installation
You must first install the python3-avahi bindings. These are handled by apt on ubuntu and can be installed with sudo apt install python3-avahi
You can install avahi-json itself using pipx with the following command (--system-site-packages is needed for avahi and dbus).
pipx install --system-site-packages avahi-json
You need to have avahi, Linux's mdns daemon, installed to use this. But this tends to be installed by default.
Usage
Run avahi-json this will give you services on the network using JSON.
About me
I am @readwithai. I create tools for reading, research and agency sometimes using the markdown editor Obsidian.
I also create a stream of tools that are related to carrying out my work.
I write about lots of things - including tools like this - on X. My blog is more about reading and research and agency.
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
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
File details
Details for the file avahi_json-1.0.0.tar.gz.
File metadata
- Download URL: avahi_json-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42d66c3cde19204c84871947070535fd6c9ccb2faa69a3bc80357c124b8318a0
|
|
| MD5 |
36485146e9179f26a1fca15942188a54
|
|
| BLAKE2b-256 |
afe0843bb71f3ec3c587c402dee4b8e2a89a0b0b068c86135f1f9f6542281170
|
File details
Details for the file avahi_json-1.0.0-py3-none-any.whl.
File metadata
- Download URL: avahi_json-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
452309929babd0717f7a4129018a08fd2d35c8f76015d5ff0b82348f01d2435e
|
|
| MD5 |
dcad68f7913b7aa7c30660d32f3a0cb6
|
|
| BLAKE2b-256 |
db9da2d58954550fa8095631d2713259860c0e26a814597215b8a27bee216874
|