Name | slack-notif JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | A simple slack notification tool to alert you when scripts finish running. |
upload_time | 2025-01-27 03:59:35 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | None |
keywords |
slack
notification
alert
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# slack-notif
A simple Python package to send well-structured Slack notifications for your scripts, including success/error status, execution time, and custom content.
## Installation
```bash
pip install slack-notif
```
## Usage
First, you'll need a Slack bot token. Create one at https://api.slack.com/apps.
### Basic Usage
```python
from slack_notif import NotificationManager
# Initialize the notification manager
notif = NotificationManager(
token="xoxb-your-token",
channel="#your-channel"
)
# Use as a decorator
@notif.notify
def my_function():
# Your code here
pass
# Add extra content to notifications
@notif.notify(extra_content={"Environment": "Production", "Version": "1.0.0"})
def another_function():
# Your code here
pass
# Or send notifications manually
notif.send_notification(
status="success",
message="Data processing complete",
duration=42.5, # seconds
extra_content={"Rows Processed": 1000}
)
```
### Features
- ✨ Clean, modern Slack message formatting
- ⏱️ Automatic execution time tracking
- 🎯 Success/error status with appropriate colors
- 📝 Support for custom additional content
- 🔄 Easy-to-use decorator syntax
- ⚡ Simple manual notification sending
### Example Output
The notifications will include:
- A header with the script status (Success/Error)
- The main message
- Execution duration (if provided)
- Any extra content in a clean key-value format
## Development
To set up for development:
```bash
pip install -e ".[dev]"
```
## License
Not affiliated with Slack.
MIT
Raw data
{
"_id": null,
"home_page": null,
"name": "slack-notif",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "slack, notification, alert",
"author": null,
"author_email": "Jesse Gordon <jesse@vamos-labs.com>",
"download_url": "https://files.pythonhosted.org/packages/0d/8c/8c50286c7d033e153d5f180063a68457ee64a27234351be2f736c3c839c3/slack_notif-0.1.0.tar.gz",
"platform": null,
"description": "# slack-notif\n\nA simple Python package to send well-structured Slack notifications for your scripts, including success/error status, execution time, and custom content.\n\n## Installation\n\n```bash\npip install slack-notif\n```\n\n## Usage\n\nFirst, you'll need a Slack bot token. Create one at https://api.slack.com/apps.\n\n### Basic Usage\n\n```python\nfrom slack_notif import NotificationManager\n\n# Initialize the notification manager\nnotif = NotificationManager(\n token=\"xoxb-your-token\",\n channel=\"#your-channel\"\n)\n\n# Use as a decorator\n@notif.notify\ndef my_function():\n # Your code here\n pass\n\n# Add extra content to notifications\n@notif.notify(extra_content={\"Environment\": \"Production\", \"Version\": \"1.0.0\"})\ndef another_function():\n # Your code here\n pass\n\n# Or send notifications manually\nnotif.send_notification(\n status=\"success\",\n message=\"Data processing complete\",\n duration=42.5, # seconds\n extra_content={\"Rows Processed\": 1000}\n)\n```\n\n### Features\n\n- \u2728 Clean, modern Slack message formatting\n- \u23f1\ufe0f Automatic execution time tracking\n- \ud83c\udfaf Success/error status with appropriate colors\n- \ud83d\udcdd Support for custom additional content\n- \ud83d\udd04 Easy-to-use decorator syntax\n- \u26a1 Simple manual notification sending\n\n### Example Output\n\nThe notifications will include:\n- A header with the script status (Success/Error)\n- The main message\n- Execution duration (if provided)\n- Any extra content in a clean key-value format\n\n## Development\n\nTo set up for development:\n\n```bash\npip install -e \".[dev]\"\n```\n\n## License\n\nNot affiliated with Slack.\n\nMIT \n",
"bugtrack_url": null,
"license": null,
"summary": "A simple slack notification tool to alert you when scripts finish running.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/vamos-lab/slack-notif"
},
"split_keywords": [
"slack",
" notification",
" alert"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "58d16d25393df8b24db499ccaeef5c10153b0dd28df49bec8aef137c54e2df9a",
"md5": "b48e6d675e882970c647920d9219f611",
"sha256": "84f6ef42d54957261e1dc0ce0d3354d9440960dd58137f197f375da6b8bdfc47"
},
"downloads": -1,
"filename": "slack_notif-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b48e6d675e882970c647920d9219f611",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 2041,
"upload_time": "2025-01-27T03:59:32",
"upload_time_iso_8601": "2025-01-27T03:59:32.831328Z",
"url": "https://files.pythonhosted.org/packages/58/d1/6d25393df8b24db499ccaeef5c10153b0dd28df49bec8aef137c54e2df9a/slack_notif-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0d8c8c50286c7d033e153d5f180063a68457ee64a27234351be2f736c3c839c3",
"md5": "d5161ad1497597526be5ae24911fc659",
"sha256": "016a1b2352607ffc886c8424f55c4ca723a3bdbb662584cc5dda6e6fa0710c85"
},
"downloads": -1,
"filename": "slack_notif-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "d5161ad1497597526be5ae24911fc659",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2155,
"upload_time": "2025-01-27T03:59:35",
"upload_time_iso_8601": "2025-01-27T03:59:35.411773Z",
"url": "https://files.pythonhosted.org/packages/0d/8c/8c50286c7d033e153d5f180063a68457ee64a27234351be2f736c3c839c3/slack_notif-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-27 03:59:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vamos-lab",
"github_project": "slack-notif",
"github_not_found": true,
"lcname": "slack-notif"
}