# alerts_msg (v0.2.1)
## DESCRIPTION_SHORT
All abilities (mail/telegram) to send alert msgs (threading)
## DESCRIPTION_LONG
designed for ...
## Features
1. send alert msgs:
- emails
- telegram
2. threading
********************************************************************************
## License
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
## Release history
See the [HISTORY.md](HISTORY.md) file for release history.
## Installation
```commandline
pip install alerts-msg
```
## Import
```python
from alerts_msg import *
```
********************************************************************************
## USAGE EXAMPLES
See tests and sourcecode for other examples.
------------------------------
### 1. example1.py
```python
# =========================================================================================
### 0. BEST PRACTICE
from alerts_msg import *
class AlertADX(AlertSelect.TELEGRAM_DEF):
pass
AlertADX("hello")
AlertADX("World")
AlertADX.threads_wait_all()
# =========================================================================================
# =========================================================================================
# =========================================================================================
### AlertSmtp
#### 1. add new server if not exists
from alerts_msg import *
class SmtpServersMOD(SmtpServers):
EXAMPLE_RU: SmtpAddress = SmtpAddress("smtp.EXAMPLE.ru", 123)
class AlertSmtpMOD(AlertSmtp):
SERVER_SMTP: SmtpAddress = SmtpServersMOD.EXAMPLE_RU # or direct =SmtpAddress("smtp.EXAMPLE.ru", 123)
# =========================================================================================
#### 2. change authorisation data (see `private_values` for details)
from alerts_msg import *
class AlertSmtpMOD(AlertSmtp):
AUTH: PrivateAuto = PrivateAuto(_section="AUTH_EMAIL_MOD")
# =========================================================================================
#### 3. change other settings (see source for other not mentioned)
from alerts_msg import *
class AlertSmtpMOD(AlertSmtp):
RECONNECT_PAUSE: int = 60
RECONNECT_LIMIT: int = 10
TIMEOUT_RATELIMIT: int = 600
RECIPIENT_SPECIAL: str = "my_address_2@mail.ru"
# =========================================================================================
#### 4. send
# if no mods
from alerts_msg import *
AlertSmtp(_subj_name="Hello", body="World!")
# with mods
from alerts_msg import *
class AlertSmtpMOD(AlertSmtp):
pass # changed
AlertSmtpMOD(_subj_name="Hello", body="World!")
# =========================================================================================
#### 5. using in class with saving alert object
from alerts_msg import *
class AlertSmtpMOD(AlertSmtp):
pass # changed
class MyMonitor:
ALERT = AlertSmtpMOD
monitor = MyMonitor()
monitor.ALERT("Hello")
# =========================================================================================
# =========================================================================================
### AlertTelegram
# All idea is similar to AlertSmtp.
# add auth data
# add pv.json or do smth else (for details see private_values.PrivateJsonTgBotAddress)
# json
{
"TG_ID": {"MyTgID": 1234567890},
"TGBOT_DEF": {
"LINK_ID": "@my_bot_20230916",
"NAME": "my_bot",
"TOKEN": "9876543210xxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
# =========================================================================================
from alerts_msg import *
class MyMonitor:
ALERT = AlertTelegram
monitor = MyMonitor()
monitor.ALERT("Hello")
```
********************************************************************************
Raw data
{
"_id": null,
"home_page": "https://github.com/centroid457/",
"name": "alerts-msg",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "alerts,notifications,email alerts,smtp,mail,email,telegram alerts,telegram",
"author": "Andrei Starichenko",
"author_email": "centroid@mail.ru",
"download_url": "https://files.pythonhosted.org/packages/3e/d6/b6bffcee8d561a96eb06f7b5e4777929f2153d8fc61f8747fb37cab5093e/alerts_msg-0.2.1.tar.gz",
"platform": null,
"description": "# alerts_msg (v0.2.1)\r\n\r\n## DESCRIPTION_SHORT\r\nAll abilities (mail/telegram) to send alert msgs (threading)\r\n\r\n## DESCRIPTION_LONG\r\ndesigned for ...\r\n\r\n\r\n## Features\r\n1. send alert msgs: \r\n\t- emails \r\n\t- telegram \r\n2. threading \r\n\r\n\r\n********************************************************************************\r\n## License\r\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).\r\n\r\n\r\n## Release history\r\nSee the [HISTORY.md](HISTORY.md) file for release history.\r\n\r\n\r\n## Installation\r\n```commandline\r\npip install alerts-msg\r\n```\r\n\r\n\r\n## Import\r\n```python\r\nfrom alerts_msg import *\r\n```\r\n\r\n\r\n********************************************************************************\r\n## USAGE EXAMPLES\r\nSee tests and sourcecode for other examples.\r\n\r\n------------------------------\r\n### 1. example1.py\r\n```python\r\n# =========================================================================================\r\n### 0. BEST PRACTICE\r\nfrom alerts_msg import *\r\n\r\nclass AlertADX(AlertSelect.TELEGRAM_DEF):\r\n pass\r\n\r\nAlertADX(\"hello\")\r\nAlertADX(\"World\")\r\nAlertADX.threads_wait_all()\r\n\r\n# =========================================================================================\r\n# =========================================================================================\r\n# =========================================================================================\r\n### AlertSmtp\r\n#### 1. add new server if not exists\r\nfrom alerts_msg import *\r\n\r\n\r\nclass SmtpServersMOD(SmtpServers):\r\n EXAMPLE_RU: SmtpAddress = SmtpAddress(\"smtp.EXAMPLE.ru\", 123)\r\n\r\n\r\nclass AlertSmtpMOD(AlertSmtp):\r\n SERVER_SMTP: SmtpAddress = SmtpServersMOD.EXAMPLE_RU # or direct =SmtpAddress(\"smtp.EXAMPLE.ru\", 123)\r\n\r\n# =========================================================================================\r\n#### 2. change authorisation data (see `private_values` for details)\r\nfrom alerts_msg import *\r\n\r\n\r\nclass AlertSmtpMOD(AlertSmtp):\r\n AUTH: PrivateAuto = PrivateAuto(_section=\"AUTH_EMAIL_MOD\")\r\n\r\n# =========================================================================================\r\n#### 3. change other settings (see source for other not mentioned)\r\nfrom alerts_msg import *\r\n\r\n\r\nclass AlertSmtpMOD(AlertSmtp):\r\n RECONNECT_PAUSE: int = 60\r\n RECONNECT_LIMIT: int = 10\r\n\r\n TIMEOUT_RATELIMIT: int = 600\r\n\r\n RECIPIENT_SPECIAL: str = \"my_address_2@mail.ru\"\r\n\r\n# =========================================================================================\r\n#### 4. send\r\n# if no mods\r\nfrom alerts_msg import *\r\n\r\nAlertSmtp(_subj_name=\"Hello\", body=\"World!\")\r\n\r\n# with mods\r\nfrom alerts_msg import *\r\n\r\n\r\nclass AlertSmtpMOD(AlertSmtp):\r\n pass # changed\r\n\r\n\r\nAlertSmtpMOD(_subj_name=\"Hello\", body=\"World!\")\r\n\r\n# =========================================================================================\r\n#### 5. using in class with saving alert object\r\nfrom alerts_msg import *\r\n\r\nclass AlertSmtpMOD(AlertSmtp):\r\n pass # changed\r\n\r\nclass MyMonitor:\r\n ALERT = AlertSmtpMOD\r\n\r\nmonitor = MyMonitor()\r\nmonitor.ALERT(\"Hello\")\r\n\r\n# =========================================================================================\r\n# =========================================================================================\r\n### AlertTelegram\r\n# All idea is similar to AlertSmtp.\r\n\r\n# add auth data\r\n# add pv.json or do smth else (for details see private_values.PrivateJsonTgBotAddress)\r\n# json\r\n{\r\n \"TG_ID\": {\"MyTgID\": 1234567890},\r\n \"TGBOT_DEF\": {\r\n \"LINK_ID\": \"@my_bot_20230916\",\r\n \"NAME\": \"my_bot\",\r\n \"TOKEN\": \"9876543210xxxxxxxxxxxxxxxxxxxxxxxxx\"\r\n }\r\n}\r\n\r\n# =========================================================================================\r\nfrom alerts_msg import *\r\n\r\nclass MyMonitor:\r\n ALERT = AlertTelegram\r\n\r\nmonitor = MyMonitor()\r\nmonitor.ALERT(\"Hello\")\r\n```\r\n\r\n********************************************************************************\r\n",
"bugtrack_url": null,
"license": "",
"summary": "All abilities (mail/telegram) to send alert msgs (threading)",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/centroid457/",
"Source": "https://github.com/centroid457/alerts_msg"
},
"split_keywords": [
"alerts",
"notifications",
"email alerts",
"smtp",
"mail",
"email",
"telegram alerts",
"telegram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ab81c06a0392fbc67720ee2c4d4e5aceb2a3330098eb6d94b094c4e12217f3c6",
"md5": "8b84f66716a20b0853d7f74a291a659b",
"sha256": "f0436321690bc468870e4c82f4f3a61ce5ad59cc00ea3acb33bfd9f27d0b1cdb"
},
"downloads": -1,
"filename": "alerts_msg-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8b84f66716a20b0853d7f74a291a659b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7942,
"upload_time": "2024-01-14T04:09:13",
"upload_time_iso_8601": "2024-01-14T04:09:13.226956Z",
"url": "https://files.pythonhosted.org/packages/ab/81/c06a0392fbc67720ee2c4d4e5aceb2a3330098eb6d94b094c4e12217f3c6/alerts_msg-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3ed6b6bffcee8d561a96eb06f7b5e4777929f2153d8fc61f8747fb37cab5093e",
"md5": "74d30939aa62b5e7cefff7ef034f0df1",
"sha256": "2049cb3bf3c17736c0b9aa166298ba9b20796e8051c3ae3187c0904852c38070"
},
"downloads": -1,
"filename": "alerts_msg-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "74d30939aa62b5e7cefff7ef034f0df1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7249,
"upload_time": "2024-01-14T04:09:14",
"upload_time_iso_8601": "2024-01-14T04:09:14.925945Z",
"url": "https://files.pythonhosted.org/packages/3e/d6/b6bffcee8d561a96eb06f7b5e4777929f2153d8fc61f8747fb37cab5093e/alerts_msg-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-14 04:09:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "centroid457",
"github_project": "alerts_msg",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "alerts-msg"
}