python-alert


Namepython-alert JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/NeverMendel/alert-me
SummaryMulti-Platform Python tool to send notifications to your devices
upload_time2024-04-16 16:10:05
maintainerNone
docs_urlNone
authorDavide Cazzin
requires_python>=3.8
licenseMIT
keywords python-alert alert-me notify-me email notification
VCS
bugtrack_url
requirements configparser requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # alert-me

Multi-Platform Python tool to send notifications to your devices. alert-me allows you to send notifications to your devices using different services.

## 📝 Table of Contents

- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [Config](#config)
- [Command line arguments](#command-line-arguments)
- [License](#license)

## 📕 About <a name="about"></a>

alert-me is a multi-platform Python tool to send notifications to your devices. It supports different plugins to send notifications via different services.

Available plugins:

- Email
- Telegram
- Url

Creating additional plugins is easy. Just create a new class that inherits from `Plugin` and implements the `notify` method.

## ⚙️ Installation <a name="installation"></a>

## Python repository

The easiest way to get alert-me is through the pypi.org repository. Install it by running the following command:

```bash
pip install python-alert
```

## Building from source

To install alert-me from source, clone this repository and run `pip install .` as follows:

```bash
git clone https://github.com/NeverMendel/alert-me.git
cd alert-me
pip install .
```

## 📖 Usage <a name="usage"></a>

### Command line

alert-me can be used from the command line by invoking the `alert-me` command. It accepts a number of [arguments](#command-line-arguments) to configure the alert.

```bash
alert-me -p telegram <TOKEN> <CHAT_ID> "Hello!"

alert-me -c telegram "Hello!"
alert-me -c email to_email@example.com "subject" "body"
```

### Python

alert-me can be used as a Python module by importing `AlertMe`.

```python
from alert_me.alert_me import AlertMe
from alert_me.plugins.telegram import TelegramPlugin
from alert_me.config import get_config

alert_me = AlertMe([TelegramPlugin("<TOKEN>", "<CHAT_ID>")])
alert_me.notify("Hello!")

alert_me = AlertMe([get_config("email")])
alert_me.notify("to_email@example.com", "subject", "body")
```

## Config

alert-me can be used to fetch the configuration from a file. The file must be in the [INI format](https://en.wikipedia.org/wiki/INI_file) and be located in the user home directory (`~/.alert-me.ini`).

Here is an example of a configuration file:

```ini
[telegram]
plugin = telegram
token = <TOKEN>
chat_id = <CHAT_ID>

[email]
plugin = email
smtp_server = <SMTP_SERVER>
smtp_port = <SMTP_PORT>
sender_email = <SENDER_EMAIL>
sender_password = <SENDER_PASSWORD>
```

## Command line arguments

```
usage: alert-me [-h] (-c CONFIG_UNPROCESSED | -p PLUGIN) [-v] [-vv] [-V] ...

Multi-Platform Python tool to send notifications to your devices

positional arguments:
  args                  Plugin and/or notify arguments

options:
  -h, --help            show this help message and exit
  -c CONFIG_UNPROCESSED, --config CONFIG_UNPROCESSED
                        Configuration name
                        syntax: --config=[config_name1],[config_name2],...
                        example: --config=telegram,email
  -p PLUGIN, --plugin PLUGIN
                        Plugin name
  -v, --verbose         enable verbose logging
  -vv, --extra-verbose  enable extra verbose logging
  -V, --version         show program's version number and exit
```

## License

[MIT License](LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NeverMendel/alert-me",
    "name": "python-alert",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python-alert, alert-me, notify-me, email, notification",
    "author": "Davide Cazzin",
    "author_email": "28535750+NeverMendel@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/86/00/41d268382c7627e3462903342c41bbc0366b610251aeac782244a0f6e05c/python_alert-0.1.0.tar.gz",
    "platform": null,
    "description": "# alert-me\n\nMulti-Platform Python tool to send notifications to your devices. alert-me allows you to send notifications to your devices using different services.\n\n## \ud83d\udcdd Table of Contents\n\n- [About](#about)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Config](#config)\n- [Command line arguments](#command-line-arguments)\n- [License](#license)\n\n## \ud83d\udcd5 About <a name=\"about\"></a>\n\nalert-me is a multi-platform Python tool to send notifications to your devices. It supports different plugins to send notifications via different services.\n\nAvailable plugins:\n\n- Email\n- Telegram\n- Url\n\nCreating additional plugins is easy. Just create a new class that inherits from `Plugin` and implements the `notify` method.\n\n## \u2699\ufe0f Installation <a name=\"installation\"></a>\n\n## Python repository\n\nThe easiest way to get alert-me is through the pypi.org repository. Install it by running the following command:\n\n```bash\npip install python-alert\n```\n\n## Building from source\n\nTo install alert-me from source, clone this repository and run `pip install .` as follows:\n\n```bash\ngit clone https://github.com/NeverMendel/alert-me.git\ncd alert-me\npip install .\n```\n\n## \ud83d\udcd6 Usage <a name=\"usage\"></a>\n\n### Command line\n\nalert-me can be used from the command line by invoking the `alert-me` command. It accepts a number of [arguments](#command-line-arguments) to configure the alert.\n\n```bash\nalert-me -p telegram <TOKEN> <CHAT_ID> \"Hello!\"\n\nalert-me -c telegram \"Hello!\"\nalert-me -c email to_email@example.com \"subject\" \"body\"\n```\n\n### Python\n\nalert-me can be used as a Python module by importing `AlertMe`.\n\n```python\nfrom alert_me.alert_me import AlertMe\nfrom alert_me.plugins.telegram import TelegramPlugin\nfrom alert_me.config import get_config\n\nalert_me = AlertMe([TelegramPlugin(\"<TOKEN>\", \"<CHAT_ID>\")])\nalert_me.notify(\"Hello!\")\n\nalert_me = AlertMe([get_config(\"email\")])\nalert_me.notify(\"to_email@example.com\", \"subject\", \"body\")\n```\n\n## Config\n\nalert-me can be used to fetch the configuration from a file. The file must be in the [INI format](https://en.wikipedia.org/wiki/INI_file) and be located in the user home directory (`~/.alert-me.ini`).\n\nHere is an example of a configuration file:\n\n```ini\n[telegram]\nplugin = telegram\ntoken = <TOKEN>\nchat_id = <CHAT_ID>\n\n[email]\nplugin = email\nsmtp_server = <SMTP_SERVER>\nsmtp_port = <SMTP_PORT>\nsender_email = <SENDER_EMAIL>\nsender_password = <SENDER_PASSWORD>\n```\n\n## Command line arguments\n\n```\nusage: alert-me [-h] (-c CONFIG_UNPROCESSED | -p PLUGIN) [-v] [-vv] [-V] ...\n\nMulti-Platform Python tool to send notifications to your devices\n\npositional arguments:\n  args                  Plugin and/or notify arguments\n\noptions:\n  -h, --help            show this help message and exit\n  -c CONFIG_UNPROCESSED, --config CONFIG_UNPROCESSED\n                        Configuration name\n                        syntax: --config=[config_name1],[config_name2],...\n                        example: --config=telegram,email\n  -p PLUGIN, --plugin PLUGIN\n                        Plugin name\n  -v, --verbose         enable verbose logging\n  -vv, --extra-verbose  enable extra verbose logging\n  -V, --version         show program's version number and exit\n```\n\n## License\n\n[MIT License](LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Multi-Platform Python tool to send notifications to your devices",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/NeverMendel/alert-me"
    },
    "split_keywords": [
        "python-alert",
        " alert-me",
        " notify-me",
        " email",
        " notification"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e614dd7b4bee986bbd5883a99549feb254e755fa96d38c66e5f01e50b56ff0d",
                "md5": "09776d31b5d3849e9e6c705ab95ab7e9",
                "sha256": "ab5d12cd256457cccd50c89ce62a65ec276c8f158d256eab74557ca28b8b9f6d"
            },
            "downloads": -1,
            "filename": "python_alert-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09776d31b5d3849e9e6c705ab95ab7e9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9173,
            "upload_time": "2024-04-16T16:10:02",
            "upload_time_iso_8601": "2024-04-16T16:10:02.838942Z",
            "url": "https://files.pythonhosted.org/packages/3e/61/4dd7b4bee986bbd5883a99549feb254e755fa96d38c66e5f01e50b56ff0d/python_alert-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "860041d268382c7627e3462903342c41bbc0366b610251aeac782244a0f6e05c",
                "md5": "e047df13d5b4aa031ca4767098cf209d",
                "sha256": "1ac773b07ccfc086c048ed1a179f418547b4ed1c838133503d4972bef5b0472e"
            },
            "downloads": -1,
            "filename": "python_alert-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e047df13d5b4aa031ca4767098cf209d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8513,
            "upload_time": "2024-04-16T16:10:05",
            "upload_time_iso_8601": "2024-04-16T16:10:05.773147Z",
            "url": "https://files.pythonhosted.org/packages/86/00/41d268382c7627e3462903342c41bbc0366b610251aeac782244a0f6e05c/python_alert-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 16:10:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NeverMendel",
    "github_project": "alert-me",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "configparser",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "python-alert"
}
        
Elapsed time: 0.24220s