{"library":"sdbus","title":"sdbus","description":"sdbus is a modern, asynchronous Python D-Bus library built upon `sd-bus` from `libsystemd`. It provides a robust, low-level interface for D-Bus communication, supporting both system and session buses. Currently at version 0.14.2, it maintains an active release cycle with regular updates addressing bug fixes and feature enhancements.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install sdbus"],"cli":null},"imports":["from sdbus.bus import SystemBus","from sdbus.bus import SessionBus","from sdbus import DbusInterface","from sdbus import dbus_method","from sdbus import dbus_property"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import sdbus\nimport asyncio\n\nclass MyService(sdbus.DbusInterface):\n    DBUS_NAME = \"org.example.MyService\"\n    DBUS_PATH = \"/org/example/MyObject\"\n    DBUS_INTERFACE = \"org.example.MyInterface\"\n\n    @sdbus.dbus_method\n    def SayHello(self, name: str) -> str:\n        return f\"Hello, {name}!\"\n\nasync def main():\n    # Connect to the System Bus\n    bus = await sdbus.bus.SystemBus().connect()\n    \n    # Export an instance of MyService\n    service_object = MyService()\n    bus.export(service_object)\n    \n    # Request a D-Bus name for the service\n    await bus.request_name(MyService.DBUS_NAME)\n    \n    print(f\"Service '{MyService.DBUS_NAME}' exported on path '{MyService.DBUS_PATH}'.\")\n    print(\"To test, run in another terminal (with busctl):\")\n    print(f\"busctl call {MyService.DBUS_NAME} {MyService.DBUS_PATH} {MyService.DBUS_INTERFACE} SayHello s 'World'\")\n    print(\"Press Ctrl+C to exit.\")\n    \n    # Keep the service running indefinitely\n    await asyncio.Event().wait()\n\nif __name__ == \"__main__\":\n    try:\n        asyncio.run(main())\n    except KeyboardInterrupt:\n        print(\"\\nService stopped.\")\n","lang":"python","description":"This quickstart demonstrates how to create and export a simple D-Bus service using `sdbus`. It connects to the SystemBus, defines an interface with a method, exports an instance of that interface, and requests a D-Bus name, keeping the service alive until interrupted. This allows other D-Bus clients to call its methods.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.14.2","pypi_latest":"0.14.2","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":1.8,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"sdbus","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"sdbus","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.8,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"sdbus","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"sdbus","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.8,"import_time_s":null,"mem_mb":null,"disk_size":"22M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"sdbus","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"sdbus","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"14M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"sdbus","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"sdbus","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"14M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"sdbus","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"sdbus","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2,"import_time_s":null,"mem_mb":null,"disk_size":"20M"}]}}