slack-alerter


Nameslack-alerter JSON
Version 0.1.4 PyPI version JSON
download
home_pagehttps://github.com/hritikkarwasra/slack-alerter
SummarySlack Crash Alerter Client using Incoming Webhooks
upload_time2024-11-03 23:26:08
maintainerNone
docs_urlNone
authorHritik Karwasra
requires_python>=3.8
licenseMIT
keywords python slack alerter crash alerter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Slack Alerter

Slack Slack Alerts, Automated Crash Alerts for your projects

A Python package for sending alerts to Slack channels using webhooks. This package allows you to easily notify users about important events or errors in your application, improving monitoring and response times.

## Features

- **Customizable Alerts:** Send alerts with specific headers and messages.
- **Automatic Exception Handling:** Automatically log and notify about unhandled exceptions and threading issues.
- **Retry Mechanism:** Configurable retries for sending alerts, ensuring reliable notifications.

## Installation

You can install the package via pip:

```bash
pip install slack-alerter
```

## Usage

### Basic Example

Here’s a quick example of how to use the `slack_alerter` package:

```python
from slack_alerter import Alerts
import sys
import threading

# Initialize the Alerts class
al = Alerts(
    module_name="alerter_test",
    slack_alerts_webhook='https://hooks.slack.com/services/your/webhook/url'
)

# Send a test alert
al.alert("Custom Header", "This is a custom alert message.")

# Set up alerts for uncaught exception handling
sys.excepthook = al.handle_uncaught_exception
threading.excepthook = al.handle_uncaught_thread_exception


#Set up alerts for handled exceptions
try:
    res = 1/0
except Exception as e:
    al.send_exception_alert(e)
    #Perform other functions

```

## Configuration

The following configuration parameters are required for initializing the `Alerts` class:

- **`slack_alerts_webhook`**: Your Slack webhook URL (mandatory).
- **`module_name`**: The name of your module (mandatory).



## License

This project is licensed under the MIT License. See the LICENSE file for details.

## Author
Hritik Karwasra - https://github.com/hritikkarwasra

## Acknowledgments
Thanks to the Slack API for providing the webhook functionality that makes this package possible.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hritikkarwasra/slack-alerter",
    "name": "slack-alerter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, Slack, Alerter, Crash Alerter",
    "author": "Hritik Karwasra",
    "author_email": "khrithik0806@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/56/a2/384b3f71b815334e928db80be95cfd3cb13b794f69fdd30a138c14a90233/slack_alerter-0.1.4.tar.gz",
    "platform": null,
    "description": "# Slack Alerter\n\nSlack Slack Alerts, Automated Crash Alerts for your projects\n\nA Python package for sending alerts to Slack channels using webhooks. This package allows you to easily notify users about important events or errors in your application, improving monitoring and response times.\n\n## Features\n\n- **Customizable Alerts:** Send alerts with specific headers and messages.\n- **Automatic Exception Handling:** Automatically log and notify about unhandled exceptions and threading issues.\n- **Retry Mechanism:** Configurable retries for sending alerts, ensuring reliable notifications.\n\n## Installation\n\nYou can install the package via pip:\n\n```bash\npip install slack-alerter\n```\n\n## Usage\n\n### Basic Example\n\nHere\u2019s a quick example of how to use the `slack_alerter` package:\n\n```python\nfrom slack_alerter import Alerts\nimport sys\nimport threading\n\n# Initialize the Alerts class\nal = Alerts(\n    module_name=\"alerter_test\",\n    slack_alerts_webhook='https://hooks.slack.com/services/your/webhook/url'\n)\n\n# Send a test alert\nal.alert(\"Custom Header\", \"This is a custom alert message.\")\n\n# Set up alerts for uncaught exception handling\nsys.excepthook = al.handle_uncaught_exception\nthreading.excepthook = al.handle_uncaught_thread_exception\n\n\n#Set up alerts for handled exceptions\ntry:\n    res = 1/0\nexcept Exception as e:\n    al.send_exception_alert(e)\n    #Perform other functions\n\n```\n\n## Configuration\n\nThe following configuration parameters are required for initializing the `Alerts` class:\n\n- **`slack_alerts_webhook`**: Your Slack webhook URL (mandatory).\n- **`module_name`**: The name of your module (mandatory).\n\n\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Author\nHritik Karwasra - https://github.com/hritikkarwasra\n\n## Acknowledgments\nThanks to the Slack API for providing the webhook functionality that makes this package possible.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Slack Crash Alerter Client using Incoming Webhooks",
    "version": "0.1.4",
    "project_urls": {
        "Documentation": "https://github.com/hritikkarwasra/slack-alerter",
        "Homepage": "https://github.com/hritikkarwasra/slack-alerter",
        "Source": "https://github.com/hritikkarwasra/slack-alerter"
    },
    "split_keywords": [
        "python",
        " slack",
        " alerter",
        " crash alerter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f73a3e24e0c528f069d070dd86dbd5fa0db8504e9ee87becd30fea9d94b4e8c0",
                "md5": "63e1249320c2f0d37d95a4124f783499",
                "sha256": "aa0399eb05fda5fd8954869eb6a6ecf43bca7f5957980e993d7bbf3e00e309e7"
            },
            "downloads": -1,
            "filename": "slack_alerter-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63e1249320c2f0d37d95a4124f783499",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4743,
            "upload_time": "2024-11-03T23:26:07",
            "upload_time_iso_8601": "2024-11-03T23:26:07.057420Z",
            "url": "https://files.pythonhosted.org/packages/f7/3a/3e24e0c528f069d070dd86dbd5fa0db8504e9ee87becd30fea9d94b4e8c0/slack_alerter-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56a2384b3f71b815334e928db80be95cfd3cb13b794f69fdd30a138c14a90233",
                "md5": "ad87fd93eabc58acdea351ebb78d3cd5",
                "sha256": "b2d1e07782989834fde205bb741d08ff417dd50db48f85943f85937884a672d7"
            },
            "downloads": -1,
            "filename": "slack_alerter-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ad87fd93eabc58acdea351ebb78d3cd5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4523,
            "upload_time": "2024-11-03T23:26:08",
            "upload_time_iso_8601": "2024-11-03T23:26:08.629075Z",
            "url": "https://files.pythonhosted.org/packages/56/a2/384b3f71b815334e928db80be95cfd3cb13b794f69fdd30a138c14a90233/slack_alerter-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-03 23:26:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hritikkarwasra",
    "github_project": "slack-alerter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "slack-alerter"
}
        
Elapsed time: 0.35347s