dbus-fast is a high-performance Python library for interacting with the D-Bus message bus, providing an asynchronous API built on `asyncio`. It aims to be a faster and more modern alternative to older D-Bus libraries, focusing on speed and comprehensive type-hinting support. Currently at version 4.0.4, it maintains a rapid release cadence with frequent updates and bug fixes.
pip install dbus-fastVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to the D-Bus system bus and call the standard `ListNames` method on the D-Bus daemon. It prints the names of currently registered services. Remember to run this in an `asyncio` event loop.
Update your code to expect and process Python tuples for D-Bus STRUCT types. For example, `(item1, item2)` instead of `[item1, item2]`.
Ensure your development and deployment environments are running Python 3.10 or a later version. Upgrade Python if necessary.
Always `await` calls to `MessageBus` methods (e.g., `bus.connect()`, `bus.call()`) and ensure your main script uses `asyncio.run()` or similar `asyncio` entry points.
For system bus interactions, ensure the running user has the necessary permissions. Test with `BusType.SESSION` if you only need to interact with user-level services.
Ensure 'dbus-fast' is installed using pip: `pip install dbus-fast`. If using virtual environments, activate the correct environment before running the code.
Ensure you are importing and instantiating the correct `MessageBus` implementation, typically `from dbus_fast.aio import MessageBus` for asyncio, and then use `await bus.get_proxy_object(bus_name, object_path, introspection_xml)`.
Reinstall `dbus-fast` cleanly, ideally in a fresh virtual environment: `pip uninstall dbus-fast && pip install dbus-fast`. If the problem persists, try `pip install dbus-fast --no-cache-dir` or consider updating `pip` and `setuptools`.
Implement robust error handling around D-Bus communication to catch `EOFError` (and `dbus_fast.errors.DBusError`) and logic to gracefully reconnect the `MessageBus` if the connection is lost. Verify the stability and availability of the D-Bus service you are interacting with.
No dependency data recorded yet.