<!-- markdownlint-disable -->
<p align="center">
<a href="https://github.com/NotificationsToolbox/">
<img src="https://cdn.wolfsoftware.com/assets/images/github/organisations/notificationstoolbox/black-and-white-circle-256.png" alt="NotificationsToolbox logo" />
</a>
<br />
<a href="https://github.com/NotificationsToolbox/pushover-package/actions/workflows/cicd.yml">
<img src="https://img.shields.io/github/actions/workflow/status/NotificationsToolbox/pushover-package/cicd.yml?branch=master&label=build%20status&style=for-the-badge" alt="Github Build Status" />
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package/blob/master/LICENSE.md">
<img src="https://img.shields.io/github/license/NotificationsToolbox/pushover-package?color=blue&label=License&style=for-the-badge" alt="License">
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package">
<img src="https://img.shields.io/github/created-at/NotificationsToolbox/pushover-package?color=blue&label=Created&style=for-the-badge" alt="Created">
</a>
<br />
<a href="https://github.com/NotificationsToolbox/pushover-package/releases/latest">
<img src="https://img.shields.io/github/v/release/NotificationsToolbox/pushover-package?color=blue&label=Latest%20Release&style=for-the-badge" alt="Release">
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package/releases/latest">
<img src="https://img.shields.io/github/release-date/NotificationsToolbox/pushover-package?color=blue&label=Released&style=for-the-badge" alt="Released">
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package/releases/latest">
<img src="https://img.shields.io/github/commits-since/NotificationsToolbox/pushover-package/latest.svg?color=blue&style=for-the-badge" alt="Commits since release">
</a>
<br />
<a href="https://github.com/NotificationsToolbox/pushover-package/blob/master/.github/CODE_OF_CONDUCT.md">
<img src="https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge" />
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package/blob/master/.github/CONTRIBUTING.md">
<img src="https://img.shields.io/badge/Contributing-blue?style=for-the-badge" />
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package/blob/master/.github/SECURITY.md">
<img src="https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge" />
</a>
<a href="https://github.com/NotificationsToolbox/pushover-package/issues">
<img src="https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge" />
</a>
</p>
## Overview
This project provides a Python interface to the [Pushover API](https://pushover.net/), allowing you to send notifications through the Pushover
service. The package supports sending messages, emergency messages, and group messages, as well as listing available sounds.
## Installation
To install the package, you can use `pip`:
```bash
pip install wolfsoftware.pushover
```
## Usage
Here's a basic example of how to use the Pushover package:
```python
from wolfsoftware.pushover import Pushover
# Initialize the Pushover instance
pushover = Pushover(user_key='your_user_key', api_token='your_api_token')
# Send a message
try:
response = pushover.send_message(message='Hello, this is a test message!')
print(response)
except PushoverException as e:
print(str(e))
```
## API
### Pushover Class
The `Pushover` class provides methods to interact with the Pushover API.
#### Initialization
```python
pushover = Pushover(user_key='your_user_key', api_token='your_api_token')
```
### Methods
#### send_message
Sends a message through Pushover.
```python
def send_message(message: str, title: Optional[str] = None, url: Optional[str] = None, url_title: Optional[str] = None, priority: Optional[int] = 0, sound: Optional[str] = None, device: Optional[str] = None, attachment: Optional[str] = None) -> dict:
"""
Send a message using the Pushover API.
Arguments:
message (str): The message content.
title (str, optional): The message title.
url (str, optional): A supplementary URL to show with the message.
url_title (str, optional): A title for the supplementary URL.
priority (int, optional): The priority of the message.
sound (str, optional): The name of the sound to play with the message.
device (str, optional): The device name to send the message to.
attachment (str, optional): Path to an attachment file.
Returns:
dict: The response from the Pushover API.
Raises:
PushoverException: If the request to the Pushover API fails.
"""
```
#### send_emergency_message
Sends an emergency message through Pushover.
```python
def send_emergency_message(message: str, title: Optional[str] = None, url: Optional[str] = None, url_title: Optional[str] = None, retry: Optional[int] = 30, expire: Optional[int] = 3600, sound: Optional[str] = None, device: Optional[str] = None) -> Dict:
"""
Send an emergency message using the Pushover API.
Arguments:
message (str): The message content.
title (str, optional): The message title.
url (str, optional): A supplementary URL to show with the message.
url_title (str, optional): A title for the supplementary URL.
retry (int, optional): How often (in seconds) to retry the message.
expire (int, optional): How long (in seconds) before the message expires.
sound (str, optional): The name of the sound to play with the message.
device (str, optional): The device name to send the message to.
Returns:
dict: The response from the Pushover API.
Raises:
PushoverException: If the request to the Pushover API fails.
"""
```
#### send_group_message
Sends a message to a group through Pushover.
```python
def send_group_message(message: str, group_key: str, title: Optional[str] = None, url: Optional[str] = None, url_title: Optional[str] = None, priority: Optional[int] = 0, sound: Optional[str] = None, device: Optional[str] = None, attachment: Optional[str] = None) -> Dict:
"""
Send a message to a group using the Pushover API.
Arguments:
message (str): The message content.
group_key (str): The Pushover group key.
title (str, optional): The message title.
url (str, optional): A supplementary URL to show with the message.
url_title (str, optional): A title for the supplementary URL.
priority (int, optional): The priority of the message.
sound (str, optional): The name of the sound to play with the message.
device (str, optional): The device name to send the message to.
attachment (str, optional): Path to an attachment file.
Returns:
dict: The response from the Pushover API.
Raises:
PushoverException: If the request to the Pushover API fails.
"""
```
#### list_sounds
Lists available sounds.
```python
def list_sounds(self) -> dict:
"""
List the available sounds from the Pushover API.
Returns:
dict: The response from the Pushover API.
Raises:
PushoverException: If the request to the Pushover API fails.
"""
```
<br />
<p align="right"><a href="https://wolfsoftware.com/"><img src="https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge" /></a></p>
Raw data
{
"_id": null,
"home_page": "https://github.com/NotificationsToolbox/pushover-package",
"name": "wolfsoftware.pushover",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "python, pushover",
"author": "Wolf Software",
"author_email": "pypi@wolfsoftware.com",
"download_url": "https://files.pythonhosted.org/packages/cd/64/91cdb6b71d675f49f102dd1be98b080ba8aee4660393b4e3cb263cf5d354/wolfsoftware_pushover-0.1.1.tar.gz",
"platform": null,
"description": "<!-- markdownlint-disable -->\n<p align=\"center\">\n <a href=\"https://github.com/NotificationsToolbox/\">\n <img src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/notificationstoolbox/black-and-white-circle-256.png\" alt=\"NotificationsToolbox logo\" />\n </a>\n <br />\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/actions/workflows/cicd.yml\">\n <img src=\"https://img.shields.io/github/actions/workflow/status/NotificationsToolbox/pushover-package/cicd.yml?branch=master&label=build%20status&style=for-the-badge\" alt=\"Github Build Status\" />\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/blob/master/LICENSE.md\">\n <img src=\"https://img.shields.io/github/license/NotificationsToolbox/pushover-package?color=blue&label=License&style=for-the-badge\" alt=\"License\">\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package\">\n <img src=\"https://img.shields.io/github/created-at/NotificationsToolbox/pushover-package?color=blue&label=Created&style=for-the-badge\" alt=\"Created\">\n </a>\n <br />\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/releases/latest\">\n <img src=\"https://img.shields.io/github/v/release/NotificationsToolbox/pushover-package?color=blue&label=Latest%20Release&style=for-the-badge\" alt=\"Release\">\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/releases/latest\">\n <img src=\"https://img.shields.io/github/release-date/NotificationsToolbox/pushover-package?color=blue&label=Released&style=for-the-badge\" alt=\"Released\">\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/releases/latest\">\n <img src=\"https://img.shields.io/github/commits-since/NotificationsToolbox/pushover-package/latest.svg?color=blue&style=for-the-badge\" alt=\"Commits since release\">\n </a>\n <br />\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/blob/master/.github/CODE_OF_CONDUCT.md\">\n <img src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" />\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/blob/master/.github/CONTRIBUTING.md\">\n <img src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" />\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/blob/master/.github/SECURITY.md\">\n <img src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" />\n </a>\n <a href=\"https://github.com/NotificationsToolbox/pushover-package/issues\">\n <img src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" />\n </a>\n</p>\n\n## Overview\n\nThis project provides a Python interface to the [Pushover API](https://pushover.net/), allowing you to send notifications through the Pushover\nservice. The package supports sending messages, emergency messages, and group messages, as well as listing available sounds.\n\n## Installation\n\nTo install the package, you can use `pip`:\n\n```bash\npip install wolfsoftware.pushover\n```\n\n## Usage\n\nHere's a basic example of how to use the Pushover package:\n\n```python\nfrom wolfsoftware.pushover import Pushover\n\n# Initialize the Pushover instance\npushover = Pushover(user_key='your_user_key', api_token='your_api_token')\n\n# Send a message\ntry:\n response = pushover.send_message(message='Hello, this is a test message!')\n print(response)\nexcept PushoverException as e:\n print(str(e))\n```\n\n## API\n\n### Pushover Class\n\nThe `Pushover` class provides methods to interact with the Pushover API. \n\n#### Initialization\n\n```python\npushover = Pushover(user_key='your_user_key', api_token='your_api_token')\n```\n\n### Methods\n\n#### send_message\n\nSends a message through Pushover.\n\n```python\ndef send_message(message: str, title: Optional[str] = None, url: Optional[str] = None, url_title: Optional[str] = None, priority: Optional[int] = 0, sound: Optional[str] = None, device: Optional[str] = None, attachment: Optional[str] = None) -> dict:\n \"\"\"\n Send a message using the Pushover API.\n\n Arguments:\n message (str): The message content.\n title (str, optional): The message title.\n url (str, optional): A supplementary URL to show with the message.\n url_title (str, optional): A title for the supplementary URL.\n priority (int, optional): The priority of the message.\n sound (str, optional): The name of the sound to play with the message.\n device (str, optional): The device name to send the message to.\n attachment (str, optional): Path to an attachment file.\n\n Returns:\n dict: The response from the Pushover API.\n\n Raises:\n PushoverException: If the request to the Pushover API fails.\n \"\"\"\n```\n\n#### send_emergency_message\n\nSends an emergency message through Pushover.\n\n```python\ndef send_emergency_message(message: str, title: Optional[str] = None, url: Optional[str] = None, url_title: Optional[str] = None, retry: Optional[int] = 30, expire: Optional[int] = 3600, sound: Optional[str] = None, device: Optional[str] = None) -> Dict:\n \"\"\"\n Send an emergency message using the Pushover API.\n\n Arguments:\n message (str): The message content.\n title (str, optional): The message title.\n url (str, optional): A supplementary URL to show with the message.\n url_title (str, optional): A title for the supplementary URL.\n retry (int, optional): How often (in seconds) to retry the message.\n expire (int, optional): How long (in seconds) before the message expires.\n sound (str, optional): The name of the sound to play with the message.\n device (str, optional): The device name to send the message to.\n\n Returns:\n dict: The response from the Pushover API.\n\n Raises:\n PushoverException: If the request to the Pushover API fails.\n \"\"\"\n```\n\n#### send_group_message\n\nSends a message to a group through Pushover.\n\n```python\ndef send_group_message(message: str, group_key: str, title: Optional[str] = None, url: Optional[str] = None, url_title: Optional[str] = None, priority: Optional[int] = 0, sound: Optional[str] = None, device: Optional[str] = None, attachment: Optional[str] = None) -> Dict:\n \"\"\"\n Send a message to a group using the Pushover API.\n\n Arguments:\n message (str): The message content.\n group_key (str): The Pushover group key.\n title (str, optional): The message title.\n url (str, optional): A supplementary URL to show with the message.\n url_title (str, optional): A title for the supplementary URL.\n priority (int, optional): The priority of the message.\n sound (str, optional): The name of the sound to play with the message.\n device (str, optional): The device name to send the message to.\n attachment (str, optional): Path to an attachment file.\n\n Returns:\n dict: The response from the Pushover API.\n\n Raises:\n PushoverException: If the request to the Pushover API fails.\n \"\"\"\n```\n\n#### list_sounds\n\nLists available sounds.\n\n```python\ndef list_sounds(self) -> dict:\n \"\"\"\n List the available sounds from the Pushover API.\n\n Returns:\n dict: The response from the Pushover API.\n\n Raises:\n PushoverException: If the request to the Pushover API fails.\n \"\"\"\n```\n\n<br />\n<p align=\"right\"><a href=\"https://wolfsoftware.com/\"><img src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /></a></p>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for sending messages via Pushover.",
"version": "0.1.1",
"project_urls": {
"Documentation": "https://github.com/NotificationsToolbox/pushover-package",
"Homepage": "https://github.com/NotificationsToolbox/pushover-package",
"Source": "https://github.com/NotificationsToolbox/pushover-package",
"Sponsor": "https://github.com/sponsors/WolfSoftware",
"Tracker": "https://github.com/NotificationsToolbox/pushover-package/issues/"
},
"split_keywords": [
"python",
" pushover"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fcef74f05a4c74703f938808ff55544ad92cb5acdf401bc6b656568a7d6779c0",
"md5": "0feec0229c8666cb68c408862e559a02",
"sha256": "2c353d85f8e7ede6f4f96f0493c08b9b5d209828db24e23663d0992eb29efd7c"
},
"downloads": -1,
"filename": "wolfsoftware.pushover-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0feec0229c8666cb68c408862e559a02",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6734,
"upload_time": "2024-06-26T17:19:27",
"upload_time_iso_8601": "2024-06-26T17:19:27.495949Z",
"url": "https://files.pythonhosted.org/packages/fc/ef/74f05a4c74703f938808ff55544ad92cb5acdf401bc6b656568a7d6779c0/wolfsoftware.pushover-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cd6491cdb6b71d675f49f102dd1be98b080ba8aee4660393b4e3cb263cf5d354",
"md5": "251af7047e32b762fffe049bd9d857f3",
"sha256": "9da4fb71d93f0eb8dc39c97cfe3358641ee0f8c773360a2384b2796698d0524f"
},
"downloads": -1,
"filename": "wolfsoftware_pushover-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "251af7047e32b762fffe049bd9d857f3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8425,
"upload_time": "2024-06-26T17:19:28",
"upload_time_iso_8601": "2024-06-26T17:19:28.587445Z",
"url": "https://files.pythonhosted.org/packages/cd/64/91cdb6b71d675f49f102dd1be98b080ba8aee4660393b4e3cb263cf5d354/wolfsoftware_pushover-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-26 17:19:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NotificationsToolbox",
"github_project": "pushover-package",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "wolfsoftware.pushover"
}