From ebc49c35f56b928463fd4885c6691e3b62ac3276 Mon Sep 17 00:00:00 2001 From: The Wobbler Date: Sun, 13 Apr 2025 14:20:10 +0200 Subject: [PATCH] Added a simple description of DBus --- Python/DBus/Python & DBus.md | 21 +++++++++------------ Python/DBus/SDBus.md | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 Python/DBus/SDBus.md diff --git a/Python/DBus/Python & DBus.md b/Python/DBus/Python & DBus.md index 73276de..3f76f89 100644 --- a/Python/DBus/Python & DBus.md +++ b/Python/DBus/Python & DBus.md @@ -2,20 +2,17 @@ tags: - Python - DBus -author: The Wobbler --- If you want to use DBus with Python, you may have seen that there are many Python-libraries for DBus. This page should help you pick the right one. Here i categorized some Python DBus-libraries according to my experience. -###### Usable: -- [python-sdbus](https://github.com/python-sdbus/python-sdbus) - -###### Outdated Shit: -- [pydbus](https://github.com/LEW21/pydbus) - -###### Undocumented Shit: -- [dbus-python](https://dbus.freedesktop.org/doc/dbus-python/) - -###### Useless Shit: -- [PyQt6.QtDBus & PySide6.QtDBus](https://doc.qt.io/qtforpython-6/PySide6/QtDBus/index.html) +- **Usable:** + - [[SDBus|python-sdbus]] +- **Outdated Shit:** + - [pydbus](https://github.com/LEW21/pydbus) +- **Undocumented Shit:** + - [dbus-python](https://dbus.freedesktop.org/doc/dbus-python/) +- **Useless Shit:** + - [PyQt6.QtDBus & PySide6.QtDBus](https://doc.qt.io/qtforpython-6/PySide6/QtDBus/index.html) +I think that [[SDBus|python-sdbus]] is by far the easiest to use and in comparison to the other libraries, it has a very good documentation. \ No newline at end of file diff --git a/Python/DBus/SDBus.md b/Python/DBus/SDBus.md new file mode 100644 index 0000000..5c1ae99 --- /dev/null +++ b/Python/DBus/SDBus.md @@ -0,0 +1,23 @@ +--- +tags: + - Python + - DBus +--- + +Python-sdbus is, according to my experience, the most usable DBus-library for Python, because it is still getting updates, has a simple API and a good documentation. +The only disatvantage is that you have to use asyncio to create a service. + +Project Github: https://github.com/python-sdbus/python-sdbus + + +## What is DBus? +The name comes from "Desktop Bus". +The idea behind DBus is that you have a programing language independend standard for communication between different applications. +DBus can be used to send signals to multiple applications, call methods in applications that were written in a different language or just to exchange data between processes. + +### How does DBus work? +In DBus, you have buses, interfaces and paths. +Bus names are similar to ip addresses, they consist of dot-separated characters and numbers, but every service/application can choose its own bus name. +Interfaces are objects that contain methods, properties and signals. A bus can have multiple interfaces, because every interface has its own name. An interface name is similar to a bus name. It again consists of dot-separated characters and numbers. +A path is a virtual path to a DBus-object. Every interface, for example, must have a path. +If you know the name of a service, (bus name) the interface name and the path, then you can interact with it. \ No newline at end of file