| Name | notist JSON |
| Version |
0.1.0
JSON |
| download |
| home_page | None |
| Summary | A simple package to send notifications of script execution status. |
| upload_time | 2025-10-16 18:35:19 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.9 |
| license | MIT License
Copyright (c) 2025 Kaito Baba
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
| keywords |
notification
alert
slack
discord
messaging
bot
monitoring
automation
development
productivity
kaggle
data-science
machine-learning
deep-learning
ai
artificial-intelligence
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
<h1 align="center">
<a href="https://github.com/kAIto47802/NotifyState/blob/main/README.md">
<img width="97%" height="14px" src="docs/_images/titleLine3t.svg">
</a>
NotifyState: A Simple Package to Send Notifications of Script Execution Status
<a href="https://github.com/kAIto47802/NotifyState/blob/main/README.md">
<img width="97%" height="14px" src="docs/_images/titleLine3t.svg">
</a>
</h1>
<p align="center">
NotifyState is a lightweight Python package that lets you keep track of your scripts by sending real-time notifications when they start, finish, or encounter errors.
When you're executing long-running jobs or background tasks, NotifyState helps you stay informed without constantly checking your terminal.
</p>
<div align="center">
<a target="_blank" href="https://www.python.org">
<img src="https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue" alt="Python"/>
</a>
<a href="https://kaito47802.github.io/NotifyState/index.html">
<img src="https://img.shields.io/badge/docs-latest-brightgreen?logo=read-the-docs" alt="Documentation"/>
</a>
</div>
<br><br>
<h2 align="center">
✨ Key Features ✨
</h2>
For the detailed usage and quick start guide, please refer to the document:
<a href="https://kaito47802.github.io/NotifyState/index.html">
<img src="https://img.shields.io/badge/docs-latest-brightgreen?logo=read-the-docs" alt="Documentation" align="top"/>
</a>
<h3>
<div>⌛ Real-time Notifications</div>
<a href="https://github.com/kAIto47802/NotifyState/blob/main/README.md">
<img width="70%" height="6px" src="docs/_images/line3.svg">
</a>
</h3>
Get instant updates on the status of your scripts.
You can receive notifications when your script:
- starts running;
- completes successfully; or
- encounters an error.
<h3>
<div>🛠️ Easy Integration with Simple API</div>
<a href="https://github.com/kAIto47802/NotifyState/blob/main/README.md">
<img width="70%" height="6px" src="docs/_images/line3.svg">
</a>
</h3>
#### Watch Your Functions, Blocks of Code, or Iterations
You can use `notist.watch` to monitor the execution of your functions, blocks of code, or iterations.
**Monitor functions:**
```python
import notist
# You can also optionally specify params to include in the notification
# The values passed to these parameters are also reported
@notist.watch(params=["arg1", "arg2"])
def long_task(arg1: int, arg2: str, arg3: bool) -> None:
# This function will be monitored
# You can receive notifications when it starts, ends, or encounters an error
...
# Your long-running code here
```
**Monitor blocks of code:**
```python
import notist
with notist.watch():
# Code inside this block will be monitored
# You can receive notifications when it starts, ends, or encounters an error
...
# Your long-running code here
```
**Monitor iterations (e.g., for loops):**
```python
import notist
for i in notist.watch(range(100), step=10):
# This loop will be monitored, and you'll receive notifications every 10 iterations.
...
# Your long-running code here
```
This code example send the following notifications:
- When the function starts running:
```text
Start watching <function `__main__.without_error`>
▷ Defined at: /home/kaito47802/workspace/NotifyState/sample.py:21
▷ Called from: `__main__` @ /home/kaito47802/workspace/NotifyState/sample.py:28
```
- When the function completes successfully:
```text
End watching <function `__main__.without_error`>
▷ Defined at: /home/kaito47802/workspace/NotifyState/sample.py:21
▷ Called from: `__main__` @ /home/kaito47802/workspace/NotifyState/sample.py:28
⦿ Execution time: 0s
```
- When the function encounters an error:
```text
@kAIto47802
Error while watching <function `__main__.with_error`>
▷ Defined at: /home/kaito47802/workspace/NotifyState/sample.py:15
▷ Called from: `__main__` @ /home/kaito47802/workspace/NotifyState/sample.py:30
29 │ print("Example function that raises an error")
30 │ with_error()
╭───────┄┄ ────────────
│ 31 │ print("You will see a Slack notification for the error above")
│ 32 │ print(
│ 33 │ "You can use the watch() helper as a function decorator or as a context manager"
╰─❯ Exception: This is an error
⦿ Execution time: 0s
> Traceback (most recent call last):
> File "/home/kaito47802/.pyenv/versions/3.12.0/lib/python3.12/contextlib.py", line 81, in inner
> return func(*args, **kwds)
> ^^^^^^^^^^^^^^^^^^^
> File "/home/kaito47802/workspace/NotifyState/sample.py", line 18, in with_error
> raise Exception("This is an error")
> Exception: This is an error
```
> [!NOTE]
> The above example for monitoring iterations does **not** catch exceptions automatically,
> since exceptions raised inside the for loop cannot be caught by the iterator in Python.
> If you also want to be notified when an error occurs, wrap your code in the monitoring context:
> ```python
> with notist.watch(range(100), step=10) as it:
> for i in it:
> # This loop will be monitored, and you'll receive notifications every 10 iterations.
> # If an error occurs inside this context, you'll be notified immediately.
> ...
> # Your long-running code here
> ```
#### Register Existing Functions or Methods to be Monitored
You can also use `notist.register` to register an existing function or method to be monitored.
**Monitor existing functions from libraries:**
```python
import notist
import requests
# Register the `get` function from the `requests` library
notist.register(requests, "get")
# Now any time you call `requests.get`, it will be monitored
response = requests.get("https://example.com/largefile.zip")
```
**Monitor existing methods of classes:**
```python
import notist
from transformers import Trainer
# Register the `train` method of the `Trainer` class
notist.register(Trainer, "train")
# Now any time you call `trainer.train()`, it will be monitored
trainer = Trainer(model=...)
trainer.train()
```
**Monitor existing methods of specific class instances:**
```python
import notist
from transformers import Trainer
# Create a Trainer instance
trainer = Trainer(model=...)
# Register the `train` method of the `trainer` instance
# This will not affect other instances of Trainer
notist.register(trainer, "train")
# Now any time you call `trainer.train()`, it will be monitored
trainer.train()
```
<h3>
<div>🔔 Multiple Notifiers</div>
<a href="https://github.com/kAIto47802/NotifyState/blob/main/README.md">
<img width="70%" height="6px" src="docs/_images/line3.svg">
</a>
</h3>
Currently supports Slack and Discord. If you need another notifier, feel free to open an issue or a pull request!
<br>
<h2 align="center">
📦 Installation 📦
</h2>
You can install NotifyState from our GitHub:
```bash
pip install git+https://github.com/kAIto47802/NotifyState.git
```
Raw data
{
"_id": null,
"home_page": null,
"name": "notist",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "notification, alert, slack, discord, messaging, bot, monitoring, automation, development, productivity, kaggle, data-science, machine-learning, deep-learning, ai, artificial-intelligence",
"author": null,
"author_email": "Kaito Baba <k.ai.to47802@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/2d/bd/53e7aaa7965c9f74a4d4ee664c4d3e3e04bbd05614cdd68052fa22dc7376/notist-0.1.0.tar.gz",
"platform": null,
"description": "\n<h1 align=\"center\">\n <a href=\"https://github.com/kAIto47802/NotifyState/blob/main/README.md\">\n <img width=\"97%\" height=\"14px\" src=\"docs/_images/titleLine3t.svg\">\n </a>\n NotifyState: A Simple Package to Send Notifications of Script Execution Status\n <a href=\"https://github.com/kAIto47802/NotifyState/blob/main/README.md\">\n <img width=\"97%\" height=\"14px\" src=\"docs/_images/titleLine3t.svg\">\n </a>\n</h1>\n\n<p align=\"center\">\n NotifyState is a lightweight Python package that lets you keep track of your scripts by sending real-time notifications when they start, finish, or encounter errors.\n When you're executing long-running jobs or background tasks, NotifyState helps you stay informed without constantly checking your terminal.\n</p>\n\n<div align=\"center\">\n <a target=\"_blank\" href=\"https://www.python.org\">\n <img src=\"https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue\" alt=\"Python\"/>\n </a>\n <a href=\"https://kaito47802.github.io/NotifyState/index.html\">\n <img src=\"https://img.shields.io/badge/docs-latest-brightgreen?logo=read-the-docs\" alt=\"Documentation\"/>\n </a>\n</div>\n\n<br><br>\n\n<h2 align=\"center\">\n \u2728 Key Features \u2728\n</h2>\n\nFor the detailed usage and quick start guide, please refer to the document:\n<a href=\"https://kaito47802.github.io/NotifyState/index.html\">\n <img src=\"https://img.shields.io/badge/docs-latest-brightgreen?logo=read-the-docs\" alt=\"Documentation\" align=\"top\"/>\n</a>\n\n\n<h3>\n <div>\u231b Real-time Notifications</div>\n <a href=\"https://github.com/kAIto47802/NotifyState/blob/main/README.md\">\n <img width=\"70%\" height=\"6px\" src=\"docs/_images/line3.svg\">\n</a>\n</h3>\n\nGet instant updates on the status of your scripts.\nYou can receive notifications when your script:\n\n- starts running;\n- completes successfully; or\n- encounters an error.\n\n\n<h3>\n <div>\ud83d\udee0\ufe0f Easy Integration with Simple API</div>\n <a href=\"https://github.com/kAIto47802/NotifyState/blob/main/README.md\">\n <img width=\"70%\" height=\"6px\" src=\"docs/_images/line3.svg\">\n </a>\n</h3>\n\n#### Watch Your Functions, Blocks of Code, or Iterations\n\nYou can use `notist.watch` to monitor the execution of your functions, blocks of code, or iterations.\n\n**Monitor functions:**\n\n```python\nimport notist\n\n# You can also optionally specify params to include in the notification\n# The values passed to these parameters are also reported\n@notist.watch(params=[\"arg1\", \"arg2\"])\ndef long_task(arg1: int, arg2: str, arg3: bool) -> None:\n # This function will be monitored\n # You can receive notifications when it starts, ends, or encounters an error\n ...\n # Your long-running code here\n```\n\n**Monitor blocks of code:**\n\n```python\nimport notist\n\nwith notist.watch():\n # Code inside this block will be monitored\n # You can receive notifications when it starts, ends, or encounters an error\n ...\n # Your long-running code here\n```\n\n**Monitor iterations (e.g., for loops):**\n\n```python\nimport notist\n\nfor i in notist.watch(range(100), step=10):\n # This loop will be monitored, and you'll receive notifications every 10 iterations.\n ...\n # Your long-running code here\n```\n\nThis code example send the following notifications:\n\n- When the function starts running:\n\n ```text\n Start watching <function `__main__.without_error`>\n \u25b7 Defined at: /home/kaito47802/workspace/NotifyState/sample.py:21\n \u25b7 Called from: `__main__` @ /home/kaito47802/workspace/NotifyState/sample.py:28\n ```\n\n- When the function completes successfully:\n\n ```text\n End watching <function `__main__.without_error`>\n \u25b7 Defined at: /home/kaito47802/workspace/NotifyState/sample.py:21\n \u25b7 Called from: `__main__` @ /home/kaito47802/workspace/NotifyState/sample.py:28\n \u29bf Execution time: 0s\n ```\n\n- When the function encounters an error:\n\n ```text\n @kAIto47802\n Error while watching <function `__main__.with_error`>\n \u25b7 Defined at: /home/kaito47802/workspace/NotifyState/sample.py:15\n \u25b7 Called from: `__main__` @ /home/kaito47802/workspace/NotifyState/sample.py:30\n 29 \u2502 print(\"Example function that raises an error\")\n 30 \u2502 with_error()\n \u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2504\u2504 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \u2502 31 \u2502 print(\"You will see a Slack notification for the error above\")\n \u2502 32 \u2502 print(\n \u2502 33 \u2502 \"You can use the watch() helper as a function decorator or as a context manager\"\n \u2570\u2500\u276f Exception: This is an error\n \u29bf Execution time: 0s\n\n > Traceback (most recent call last):\n > File \"/home/kaito47802/.pyenv/versions/3.12.0/lib/python3.12/contextlib.py\", line 81, in inner\n > return func(*args, **kwds)\n > ^^^^^^^^^^^^^^^^^^^\n > File \"/home/kaito47802/workspace/NotifyState/sample.py\", line 18, in with_error\n > raise Exception(\"This is an error\")\n > Exception: This is an error\n ```\n\n> [!NOTE]\n> The above example for monitoring iterations does **not** catch exceptions automatically,\n> since exceptions raised inside the for loop cannot be caught by the iterator in Python.\n> If you also want to be notified when an error occurs, wrap your code in the monitoring context:\n> ```python\n> with notist.watch(range(100), step=10) as it:\n> for i in it:\n> # This loop will be monitored, and you'll receive notifications every 10 iterations.\n> # If an error occurs inside this context, you'll be notified immediately.\n> ...\n> # Your long-running code here\n> ```\n\n#### Register Existing Functions or Methods to be Monitored\n\nYou can also use `notist.register` to register an existing function or method to be monitored.\n\n**Monitor existing functions from libraries:**\n\n```python\nimport notist\nimport requests\n\n# Register the `get` function from the `requests` library\nnotist.register(requests, \"get\")\n\n# Now any time you call `requests.get`, it will be monitored\nresponse = requests.get(\"https://example.com/largefile.zip\")\n```\n\n**Monitor existing methods of classes:**\n\n```python\nimport notist\nfrom transformers import Trainer\n\n# Register the `train` method of the `Trainer` class\nnotist.register(Trainer, \"train\")\n\n# Now any time you call `trainer.train()`, it will be monitored\ntrainer = Trainer(model=...)\ntrainer.train()\n```\n\n**Monitor existing methods of specific class instances:**\n\n```python\nimport notist\nfrom transformers import Trainer\n\n# Create a Trainer instance\ntrainer = Trainer(model=...)\n\n# Register the `train` method of the `trainer` instance\n# This will not affect other instances of Trainer\nnotist.register(trainer, \"train\")\n\n# Now any time you call `trainer.train()`, it will be monitored\ntrainer.train()\n```\n\n\n<h3>\n <div>\ud83d\udd14 Multiple Notifiers</div>\n <a href=\"https://github.com/kAIto47802/NotifyState/blob/main/README.md\">\n <img width=\"70%\" height=\"6px\" src=\"docs/_images/line3.svg\">\n </a>\n</h3>\n\n\nCurrently supports Slack and Discord. If you need another notifier, feel free to open an issue or a pull request!\n\n<br>\n\n<h2 align=\"center\">\n \ud83d\udce6 Installation \ud83d\udce6\n</h2>\n\nYou can install NotifyState from our GitHub:\n\n```bash\npip install git+https://github.com/kAIto47802/NotifyState.git\n```\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Kaito Baba\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "A simple package to send notifications of script execution status.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/kaito47802/NotifyState"
},
"split_keywords": [
"notification",
" alert",
" slack",
" discord",
" messaging",
" bot",
" monitoring",
" automation",
" development",
" productivity",
" kaggle",
" data-science",
" machine-learning",
" deep-learning",
" ai",
" artificial-intelligence"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7d4a88e1624f5f52593634ccee350fffa9c9f1210c8421f566f6416dc418890a",
"md5": "d7baabc7bf5a913825a6499780664336",
"sha256": "6c0a9bf5d45d5b2bea0430cf00ce7b2f04bb12ef848444945127e53d03167f53"
},
"downloads": -1,
"filename": "notist-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7baabc7bf5a913825a6499780664336",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 25387,
"upload_time": "2025-10-16T18:35:17",
"upload_time_iso_8601": "2025-10-16T18:35:17.452210Z",
"url": "https://files.pythonhosted.org/packages/7d/4a/88e1624f5f52593634ccee350fffa9c9f1210c8421f566f6416dc418890a/notist-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2dbd53e7aaa7965c9f74a4d4ee664c4d3e3e04bbd05614cdd68052fa22dc7376",
"md5": "da6dd3ec6602a95af78128be4e884c1f",
"sha256": "9c13cf1a5fbc8aacc7a700ef424377e07b934655d5bc0bde0d375e93d1eae75c"
},
"downloads": -1,
"filename": "notist-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "da6dd3ec6602a95af78128be4e884c1f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 24396,
"upload_time": "2025-10-16T18:35:19",
"upload_time_iso_8601": "2025-10-16T18:35:19.192480Z",
"url": "https://files.pythonhosted.org/packages/2d/bd/53e7aaa7965c9f74a4d4ee664c4d3e3e04bbd05614cdd68052fa22dc7376/notist-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-16 18:35:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kaito47802",
"github_project": "NotifyState",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "notist"
}