{"id":28258476,"url":"https://github.com/dasbus-project/dasbus","last_synced_at":"2026-03-09T19:02:48.945Z","repository":{"id":35607819,"uuid":"217320471","full_name":"dasbus-project/dasbus","owner":"dasbus-project","description":"DBus library in Python 3","archived":false,"fork":false,"pushed_at":"2024-04-22T11:17:33.000Z","size":419,"stargazers_count":105,"open_issues_count":24,"forks_count":20,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-15T12:53:29.459Z","etag":null,"topics":["dbus","glib","lazy-connection","message-bus","python3","type-hints","xml-generation"],"latest_commit_sha":null,"homepage":"https://dasbus.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dasbus-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T14:33:25.000Z","updated_at":"2025-06-10T21:34:21.000Z","dependencies_parsed_at":"2024-05-09T23:45:26.877Z","dependency_job_id":"92a0e9de-d686-446d-af8e-22cf2d376083","html_url":"https://github.com/dasbus-project/dasbus","commit_stats":null,"previous_names":["rhinstaller/dasbus"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dasbus-project/dasbus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasbus-project%2Fdasbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasbus-project%2Fdasbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasbus-project%2Fdasbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasbus-project%2Fdasbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dasbus-project","download_url":"https://codeload.github.com/dasbus-project/dasbus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasbus-project%2Fdasbus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261759265,"owners_count":23205522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbus","glib","lazy-connection","message-bus","python3","type-hints","xml-generation"],"created_at":"2025-05-20T01:14:51.169Z","updated_at":"2025-12-12T00:46:47.090Z","avatar_url":"https://github.com/dasbus-project.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# dasbus\nThis DBus library is written in Python 3, based on GLib and inspired by pydbus. Find out more in\nthe [documentation](https://dasbus.readthedocs.io/en/latest/).\n\nThe code used to be part of the [Anaconda Installer](https://github.com/rhinstaller/anaconda)\nproject. It was based on the [pydbus](https://github.com/LEW21/pydbus) library, but we replaced\nit with our own solution because its upstream development stalled. The dasbus library is\na result of this effort.\n\n[![Build Status](https://travis-ci.com/rhinstaller/dasbus.svg?branch=master)](https://travis-ci.com/rhinstaller/dasbus)\n[![Documentation Status](https://readthedocs.org/projects/dasbus/badge/?version=latest)](https://dasbus.readthedocs.io/en/latest/?badge=latest)\n[![codecov](https://codecov.io/gh/rhinstaller/dasbus/branch/master/graph/badge.svg)](https://codecov.io/gh/rhinstaller/dasbus)\n\n## Requirements\n\n* Python 3.6+\n* PyGObject 3\n\nYou can install [PyGObject](https://pygobject.readthedocs.io) provided by your operating system\nor use PyPI. The system package is usually called `python3-gi`, `python3-gobject` or `pygobject3`.\nSee the [instructions](https://pygobject.readthedocs.io/en/latest/getting_started.html) for\nyour platform (only for PyGObject, you don't need cairo or GTK).\n\nThe library is known to work with Python 3.8, PyGObject 3.34 and GLib 2.63, but these are not the\nrequired minimal versions.\n\n## Installation\n\nInstall the package from [PyPI](https://pypi.org/project/dasbus/) or install the package\nprovided by your operating system if available.\n\n### Install from PyPI\n\nFollow the instructions above to install the requirements before you install `dasbus` with `pip`.\nThe required dependencies has to be installed manually in this case.\n\n```\npip3 install dasbus\n```\n\n### Install the system package\n\nFollow the instructions for your operating system to install the `python-dasbus` package.\nThe required dependencies should be installed automatically by the system package manager.\n\n* [Arch Linux](https://dasbus.readthedocs.io/en/latest/#install-on-arch-linux)\n* [Debian / Ubuntu](https://dasbus.readthedocs.io/en/latest/#install-on-debian-ubuntu)\n* [Fedora / CentOS / RHEL](https://dasbus.readthedocs.io/en/latest/#install-on-fedora-centos-rhel)\n* [openSUSE](https://dasbus.readthedocs.io/en/latest/#install-on-opensuse)\n\n## Examples\n\nShow the current hostname.\n\n```python\nfrom dasbus.connection import SystemMessageBus\nbus = SystemMessageBus()\n\nproxy = bus.get_proxy(\n    \"org.freedesktop.hostname1\",\n    \"/org/freedesktop/hostname1\"\n)\n\nprint(proxy.Hostname)\n```\n\nSend a notification to the notification server.\n\n```python\nfrom dasbus.connection import SessionMessageBus\nbus = SessionMessageBus()\n\nproxy = bus.get_proxy(\n    \"org.freedesktop.Notifications\",\n    \"/org/freedesktop/Notifications\"\n)\n\nid = proxy.Notify(\n    \"\", 0, \"face-smile\", \"Hello World!\",\n    \"This notification can be ignored.\",\n    [], {}, 0\n)\n\nprint(\"The notification {} was sent.\".format(id))\n```\n\nHandle a closed notification.\n\n```python\nfrom dasbus.loop import EventLoop\nloop = EventLoop()\n\nfrom dasbus.connection import SessionMessageBus\nbus = SessionMessageBus()\n\nproxy = bus.get_proxy(\n    \"org.freedesktop.Notifications\",\n    \"/org/freedesktop/Notifications\"\n)\n\ndef callback(id, reason):\n    print(\"The notification {} was closed.\".format(id))\n\nproxy.NotificationClosed.connect(callback)\nloop.run()\n```\n\nAsynchronously fetch a list of network devices.\n\n```python\nfrom dasbus.loop import EventLoop\nloop = EventLoop()\n\nfrom dasbus.connection import SystemMessageBus\nbus = SystemMessageBus()\n\nproxy = bus.get_proxy(\n    \"org.freedesktop.NetworkManager\",\n    \"/org/freedesktop/NetworkManager\"\n)\n\ndef callback(call):\n    print(call())\n\nproxy.GetDevices(callback=callback)\nloop.run()\n```\n\nInhibit the system suspend and hibernation.\n\n```python\nimport os\nfrom dasbus.connection import SystemMessageBus\nfrom dasbus.unix import GLibClientUnix\nbus = SystemMessageBus()\n\nproxy = bus.get_proxy(\n    \"org.freedesktop.login1\",\n    \"/org/freedesktop/login1\",\n    client=GLibClientUnix\n)\n\nfd = proxy.Inhibit(\n    \"sleep\", \"my-example\", \"Running an example\", \"block\"\n)\n\nproxy.ListInhibitors()\nos.close(fd)\n```\n\nDefine the org.example.HelloWorld service.\n\n```python\nclass HelloWorld(object):\n    __dbus_xml__ = \"\"\"\n    \u003cnode\u003e\n        \u003cinterface name=\"org.example.HelloWorld\"\u003e\n            \u003cmethod name=\"Hello\"\u003e\n                \u003carg direction=\"in\" name=\"name\" type=\"s\" /\u003e\n                \u003carg direction=\"out\" name=\"return\" type=\"s\" /\u003e\n            \u003c/method\u003e\n        \u003c/interface\u003e\n    \u003c/node\u003e\n    \"\"\"\n\n    def Hello(self, name):\n        return \"Hello {}!\".format(name)\n```\n\nDefine the org.example.HelloWorld service with an automatically generated XML specification.\n\n```python\nfrom dasbus.server.interface import dbus_interface\nfrom dasbus.typing import Str\n\n@dbus_interface(\"org.example.HelloWorld\")\nclass HelloWorld(object):\n\n    def Hello(self, name: Str) -\u003e Str:\n        return \"Hello {}!\".format(name)\n\nprint(HelloWorld.__dbus_xml__)\n```\n\nPublish the org.example.HelloWorld service on the session message bus.\n\n```python\nfrom dasbus.connection import SessionMessageBus\nbus = SessionMessageBus()\nbus.publish_object(\"/org/example/HelloWorld\", HelloWorld())\nbus.register_service(\"org.example.HelloWorld\")\n\nfrom dasbus.loop import EventLoop\nloop = EventLoop()\nloop.run()\n```\n\nSee more examples in the [documentation](https://dasbus.readthedocs.io/en/latest/examples.html).\n\n## Inspiration\n\nLook at the [complete examples](https://github.com/rhinstaller/dasbus/tree/master/examples) or\n[DBus services](https://github.com/rhinstaller/anaconda/tree/master/pyanaconda/modules) of\nthe Anaconda Installer for more inspiration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasbus-project%2Fdasbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasbus-project%2Fdasbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasbus-project%2Fdasbus/lists"}