telegram-notifier-bot


Nametelegram-notifier-bot JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummarySend a notification to a Telegram user or group.
upload_time2023-09-08 13:07:29
maintainer
docs_urlNone
author
requires_python>=3.8.10
license
keywords telegram bot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # telegram_notifier_bot - v1.0.0

A simple package to send notifications to a Telegram user or group. 

E.g.

- Send notifications triggered by some event
  - in a monitoring system
  - an IoT device
  - a service

## Installation

### From PyPI

```bash
(venv) $ pip install telegram-notifier-bot
(venv) $
```

### From GitHub

```bash
(venv) $ pip install git+https://github.com/p4irin/telegram_notifier_bot.git
(venv) $
```

### Verify

```bash
(venv) $ python
Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import telegram_notifier_bot
>>> telegram_notifier_bot.__version__
'0.0.1'
>>>
```

## Usage

### Prerequisite

[Create a new Telegram bot](https://core.telegram.org/bots/features#creating-a-new-bot)

### Send a notification

```bash
(venv) $ export TELEGRAM_BOT_TOKEN=<Your Telegram bot token>
(venv) $ export TELEGRAM_CHAT_ID=<Recipient(s) chat or group id>
(venv) $ export TELEGRAM_PATH_TO_PHOTO=<File system path to photo>
(venv) $ python
Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> from telegram_notifier_bot import Notifier
>>> token = os.getenv('TELEGRAM_BOT_TOKEN')
>>> chat_id = os.getenv('TELEGRAM_CHAT_ID')
>>> photo = os.getenv('TELEGRAM_PATH_TO_PHOTO')
>>> notifier = Notifier(token)
>>> notifier.send("We're out of coffee! Please fix ASAP!", chat_id)
>>> notifier.send_photo(photo, chat_id)
>>>
```

## Reference

- [The Telegram Bot API](https://core.telegram.org/bots/api)
- [Requests: HTTP for Humans](https://requests.readthedocs.io/en/latest/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "telegram-notifier-bot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.10",
    "maintainer_email": "",
    "keywords": "telegram,bot",
    "author": "",
    "author_email": "p4irin <139928764+p4irin@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/03/94/a9a20baaf2091316a568b025900cc441e2bc0ceb331a7f35aad3a3086660/telegram_notifier_bot-1.0.0.tar.gz",
    "platform": null,
    "description": "# telegram_notifier_bot - v1.0.0\n\nA simple package to send notifications to a Telegram user or group. \n\nE.g.\n\n- Send notifications triggered by some event\n  - in a monitoring system\n  - an IoT device\n  - a service\n\n## Installation\n\n### From PyPI\n\n```bash\n(venv) $ pip install telegram-notifier-bot\n(venv) $\n```\n\n### From GitHub\n\n```bash\n(venv) $ pip install git+https://github.com/p4irin/telegram_notifier_bot.git\n(venv) $\n```\n\n### Verify\n\n```bash\n(venv) $ python\nPython 3.8.10 (default, Jun  2 2021, 10:49:15) \n[GCC 9.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import telegram_notifier_bot\n>>> telegram_notifier_bot.__version__\n'0.0.1'\n>>>\n```\n\n## Usage\n\n### Prerequisite\n\n[Create a new Telegram bot](https://core.telegram.org/bots/features#creating-a-new-bot)\n\n### Send a notification\n\n```bash\n(venv) $ export TELEGRAM_BOT_TOKEN=<Your Telegram bot token>\n(venv) $ export TELEGRAM_CHAT_ID=<Recipient(s) chat or group id>\n(venv) $ export TELEGRAM_PATH_TO_PHOTO=<File system path to photo>\n(venv) $ python\nPython 3.8.10 (default, Jun  2 2021, 10:49:15) \n[GCC 9.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import os\n>>> from telegram_notifier_bot import Notifier\n>>> token = os.getenv('TELEGRAM_BOT_TOKEN')\n>>> chat_id = os.getenv('TELEGRAM_CHAT_ID')\n>>> photo = os.getenv('TELEGRAM_PATH_TO_PHOTO')\n>>> notifier = Notifier(token)\n>>> notifier.send(\"We're out of coffee! Please fix ASAP!\", chat_id)\n>>> notifier.send_photo(photo, chat_id)\n>>>\n```\n\n## Reference\n\n- [The Telegram Bot API](https://core.telegram.org/bots/api)\n- [Requests: HTTP for Humans](https://requests.readthedocs.io/en/latest/)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Send a notification to a Telegram user or group.",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/p4irin/telegram_notifier_bot/issues",
        "Homepage": "https://github.com/p4irin/telegram_notifier_bot"
    },
    "split_keywords": [
        "telegram",
        "bot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f860ee9901aa844db8c6a051ca646beabe36e222b09d52465b41aec9e2613e4d",
                "md5": "7c2d2c38512b16d1d72bbf146a5b2987",
                "sha256": "2c4ef75704c8473b24487ff0bf06c3203192ff48832e6d4325cb5341dc4cb0bc"
            },
            "downloads": -1,
            "filename": "telegram_notifier_bot-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c2d2c38512b16d1d72bbf146a5b2987",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.10",
            "size": 4079,
            "upload_time": "2023-09-08T13:07:27",
            "upload_time_iso_8601": "2023-09-08T13:07:27.928970Z",
            "url": "https://files.pythonhosted.org/packages/f8/60/ee9901aa844db8c6a051ca646beabe36e222b09d52465b41aec9e2613e4d/telegram_notifier_bot-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0394a9a20baaf2091316a568b025900cc441e2bc0ceb331a7f35aad3a3086660",
                "md5": "c04d038bbaaca68f93015284f1119ac8",
                "sha256": "704fb0afc8fa366d47de45f62ef0c5b904b5b84aaa1426d3e536eaa8ea5bc0d8"
            },
            "downloads": -1,
            "filename": "telegram_notifier_bot-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c04d038bbaaca68f93015284f1119ac8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.10",
            "size": 4588,
            "upload_time": "2023-09-08T13:07:29",
            "upload_time_iso_8601": "2023-09-08T13:07:29.846592Z",
            "url": "https://files.pythonhosted.org/packages/03/94/a9a20baaf2091316a568b025900cc441e2bc0ceb331a7f35aad3a3086660/telegram_notifier_bot-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-08 13:07:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "p4irin",
    "github_project": "telegram_notifier_bot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "telegram-notifier-bot"
}
        
Elapsed time: 0.26815s