pydbus
======
.. image:: https://travis-ci.org/LEW21/pydbus.svg?branch=master
:target: https://travis-ci.org/LEW21/pydbus
.. image:: https://badge.fury.io/py/pydbus.svg
:target: https://badge.fury.io/py/pydbus
Pythonic DBus library.
Changelog: https://github.com/LEW21/pydbus/releases
Requirements
------------
* Python 2.7+ - but works best on 3.4+ (help system is nicer there)
* PyGI_ (not packaged on pypi, you need to install it from your distribution's repository - it's usually called python-gi, python-gobject or pygobject)
* GLib_ 2.46+ and girepository_ 1.46+ (Ubuntu 16.04+) - for object publication support
.. _PyGI: https://wiki.gnome.org/Projects/PyGObject
.. _GLib: https://developer.gnome.org/glib/
.. _girepository: https://wiki.gnome.org/Projects/GObjectIntrospection
Examples
--------
Send a desktop notification
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
from pydbus import SessionBus
bus = SessionBus()
notifications = bus.get('.Notifications')
notifications.Notify('test', 0, 'dialog-information', "Hello World!", "pydbus works :)", [], {}, 5000)
List systemd units
~~~~~~~~~~~~~~~~~~
.. code-block:: python
from pydbus import SystemBus
bus = SystemBus()
systemd = bus.get(".systemd1")
for unit in systemd.ListUnits():
print(unit)
Start or stop systemd unit
~~~~~~~~~~~~~~~~~~
.. code-block:: python
from pydbus import SystemBus
bus = SystemBus()
systemd = bus.get(".systemd1")
job1 = systemd.StopUnit("ssh.service", "fail")
job2 = systemd.StartUnit("ssh.service", "fail")
Watch for new systemd jobs
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
from pydbus import SystemBus
from gi.repository import GLib
bus = SystemBus()
systemd = bus.get(".systemd1")
systemd.JobNew.connect(print)
GLib.MainLoop().run()
# or
systemd.onJobNew = print
GLib.MainLoop().run()
View object's API
~~~~~~~~~~~~~~~~~
.. code-block:: python
from pydbus import SessionBus
bus = SessionBus()
notifications = bus.get('.Notifications')
help(notifications)
More examples & documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Tutorial_ contains more examples and docs.
.. _Tutorial: https://github.com/LEW21/pydbus/blob/master/doc/tutorial.rst
Copyright Information
---------------------
Copyright (C) 2014, 2015, 2016 Linus Lewandowski <linus@lew21.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Raw data
{
"_id": null,
"home_page": "https://github.com/LEW21/pydbus",
"name": "pydbus",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "dbus",
"author": "Linus Lewandowski",
"author_email": "linus@lew21.net",
"download_url": "https://files.pythonhosted.org/packages/58/56/3e84f2c1f2e39b9ea132460183f123af41e3b9c8befe222a35636baa6a5a/pydbus-0.6.0.tar.gz",
"platform": "",
"description": "pydbus\n======\n.. image:: https://travis-ci.org/LEW21/pydbus.svg?branch=master\n :target: https://travis-ci.org/LEW21/pydbus\n.. image:: https://badge.fury.io/py/pydbus.svg\n :target: https://badge.fury.io/py/pydbus\n\nPythonic DBus library.\n\nChangelog: https://github.com/LEW21/pydbus/releases\n\nRequirements\n------------\n* Python 2.7+ - but works best on 3.4+ (help system is nicer there)\n* PyGI_ (not packaged on pypi, you need to install it from your distribution's repository - it's usually called python-gi, python-gobject or pygobject)\n* GLib_ 2.46+ and girepository_ 1.46+ (Ubuntu 16.04+) - for object publication support\n\n.. _PyGI: https://wiki.gnome.org/Projects/PyGObject\n.. _GLib: https://developer.gnome.org/glib/\n.. _girepository: https://wiki.gnome.org/Projects/GObjectIntrospection\n\nExamples\n--------\n\nSend a desktop notification\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n\tfrom pydbus import SessionBus\n\n\tbus = SessionBus()\n\tnotifications = bus.get('.Notifications')\n\n\tnotifications.Notify('test', 0, 'dialog-information', \"Hello World!\", \"pydbus works :)\", [], {}, 5000)\n\nList systemd units\n~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n\tfrom pydbus import SystemBus\n\n\tbus = SystemBus()\n\tsystemd = bus.get(\".systemd1\")\n\n\tfor unit in systemd.ListUnits():\n\t print(unit)\n\nStart or stop systemd unit\n~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n\tfrom pydbus import SystemBus\n\n\tbus = SystemBus()\n\tsystemd = bus.get(\".systemd1\")\n\n\tjob1 = systemd.StopUnit(\"ssh.service\", \"fail\")\n\tjob2 = systemd.StartUnit(\"ssh.service\", \"fail\")\n\nWatch for new systemd jobs\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n\tfrom pydbus import SystemBus\n\tfrom gi.repository import GLib\n\n\tbus = SystemBus()\n\tsystemd = bus.get(\".systemd1\")\n\n\tsystemd.JobNew.connect(print)\n\tGLib.MainLoop().run()\n\n\t# or\n\n\tsystemd.onJobNew = print\n\tGLib.MainLoop().run()\n\nView object's API\n~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n\tfrom pydbus import SessionBus\n\n\tbus = SessionBus()\n\tnotifications = bus.get('.Notifications')\n\n\thelp(notifications)\n\nMore examples & documentation\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe Tutorial_ contains more examples and docs.\n\n.. _Tutorial: https://github.com/LEW21/pydbus/blob/master/doc/tutorial.rst\n\nCopyright Information\n---------------------\n\nCopyright (C) 2014, 2015, 2016 Linus Lewandowski <linus@lew21.net>\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n",
"bugtrack_url": null,
"license": "LGPLv2+",
"summary": "Pythonic DBus library",
"version": "0.6.0",
"project_urls": {
"Homepage": "https://github.com/LEW21/pydbus"
},
"split_keywords": [
"dbus"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "925627148014c2f85ce70332f18612f921f682395c7d4e91ec103783be4fce00",
"md5": "c7376988f3a6f92cd545ef4f3a8c0cf7",
"sha256": "66b80106352a718d80d6c681dc2a82588048e30b75aab933e4020eb0660bf85e"
},
"downloads": -1,
"filename": "pydbus-0.6.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c7376988f3a6f92cd545ef4f3a8c0cf7",
"packagetype": "bdist_wheel",
"python_version": "3.5",
"requires_python": null,
"size": 19580,
"upload_time": "2016-12-18T16:44:19",
"upload_time_iso_8601": "2016-12-18T16:44:19.565760Z",
"url": "https://files.pythonhosted.org/packages/92/56/27148014c2f85ce70332f18612f921f682395c7d4e91ec103783be4fce00/pydbus-0.6.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "58563e84f2c1f2e39b9ea132460183f123af41e3b9c8befe222a35636baa6a5a",
"md5": "c6abd44862322679bd4e907bebc3e0d0",
"sha256": "4207162eff54223822c185da06c1ba8a34137a9602f3da5a528eedf3f78d0f2c"
},
"downloads": -1,
"filename": "pydbus-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "c6abd44862322679bd4e907bebc3e0d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22079,
"upload_time": "2016-12-18T16:44:31",
"upload_time_iso_8601": "2016-12-18T16:44:31.904494Z",
"url": "https://files.pythonhosted.org/packages/58/56/3e84f2c1f2e39b9ea132460183f123af41e3b9c8befe222a35636baa6a5a/pydbus-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2016-12-18 16:44:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LEW21",
"github_project": "pydbus",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "pydbus"
}