{"id":9983,"library":"notify2","title":"notify2 - DBus Desktop Notifications","description":"notify2 is a Python interface to DBus notifications, allowing applications to send desktop notifications via the freedesktop.org Desktop Notifications Specification. It provides a simple API to initialize an application, create notifications with summaries, bodies, and icons, and control their display. The current version is 0.3.1, released in 2017. The project appears to be in maintenance mode, with no new feature development expected.","status":"maintenance","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/mikeboers/notify2","tags":["notifications","dbus","desktop","linux"],"install":[{"cmd":"pip install notify2","lang":"bash","label":"Install notify2"}],"dependencies":[{"reason":"Core dependency for DBus communication. Required for notifications to function.","package":"dbus-python","optional":false}],"imports":[{"wrong":"import notify2","symbol":"notify2","correct":"import notify2"}],"quickstart":{"code":"import notify2\nimport os\n\n# Initialize the notification system with your app name\n# This is required before sending any notifications\nnotify2.init(os.environ.get('NOTIFY_APP_NAME', 'MyPythonApp'))\n\n# Create a new notification\n# Arguments: summary, body (optional), icon (optional)\nn = notify2.Notification(\n    \"Hello from notify2!\", \n    \"This is a test notification generated by a Python script.\",\n    icon='dialog-information' # Example icon name (often from GTK/freedesktop theme)\n)\n\n# Set a timeout for the notification (in milliseconds)\n# -1 means 'never expire' (if supported by daemon), 0 means 'default'\nn.set_timeout(5000) # 5 seconds\n\n# Show the notification\nn.show()\nprint(\"Notification sent! Check your desktop.\")","lang":"python","description":"This quickstart initializes `notify2`, creates a basic desktop notification with a summary, body, and icon, sets a timeout, and displays it. Requires a running DBus session and a notification daemon (e.g., dunst, xfce4-notifyd) on a Linux desktop environment."},"warnings":[{"fix":"Ensure `dbus-python` is installed (`pip install dbus-python`) and a notification daemon is active and configured in your desktop environment. For server-side applications, this library is generally unsuitable.","message":"notify2 relies on `dbus-python` and a running DBus session along with a compatible desktop notification daemon (e.g., `dunst`, `xfce4-notifyd`, `notification-daemon`) on a Linux desktop environment. If these prerequisites are not met, notifications will either silently fail to appear or raise `DBusException` errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update import statements and API calls from `pynotify` to `notify2`'s syntax (e.g., `notify2.Notification` instead of `pynotify.Notification`).","message":"notify2 is the spiritual successor to the older `pynotify` library. While both interfaces with `libnotify`, `notify2` is generally preferred for modern Python applications and offers a more Pythonic API. If migrating from `pynotify`, expect API changes.","severity":"deprecated","affected_versions":"Users migrating from `pynotify`"},{"fix":"Test `notify2` thoroughly in your target environment. If persistent issues arise, consider exploring alternative notification mechanisms or newer Python libraries if available and maintained.","message":"The library's last update was in 2017 (version 0.3.1). While it generally remains functional, it might encounter subtle compatibility issues with very recent Python versions (e.g., Python 3.10+) or highly specific modern DBus configurations or desktop environments. It is not actively maintained.","severity":"gotcha","affected_versions":"Potentially Python 3.8+ and newer OS/DE versions"}],"env_vars":null,"search_vec":"'0.3.1':49 '2017':52 'allow':13 'api':29 'appear':55 'applic':14,33 'bodi':38 'control':42 'creat':34 'current':46 'dbus':2,11,68 'desktop':3,17,22,69 'develop':65 'display':44 'expect':66 'featur':64 'freedesktop.org':21 'icon':40 'initi':31 'interfac':9 'linux':70 'mainten':59 'mode':60 'new':63 'notif':4,12,18,23,35,67 'notify2':1,5 'project':54 'provid':26 'python':8 'releas':50 'send':16 'simpl':28 'specif':24 'summari':37 'version':47 'via':19","created_at":"2026-04-17T01:21:45.698819+00:00","updated_at":"2026-04-17T01:21:45.698819+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpfibdtc4l/venv/lib/python3.12/site-packages/notify2.py\", line 39, in <module>\n    import dbus\nModuleNotFoundError: No module named 'dbus'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.3.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://bitbucket.org/takluyver/pynotify2","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/notify2/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}