Telexception
Telexception is a Python module that helps track raised exceptions in your code. When an exception is raised, Telexception sends a message to a specified Telegram chat.
Features
- Sends automatic notifications to Telegram when exceptions are raised
- Can send traceback and log files for more detailed troubleshooting
- Easy to integrate into existing Python projects
Installation
You can install Telexception using pip:
pip install telexception
Usage
-
Create telegram bot via @BotFather and get API_KEY
-
Get user_id (you can find other telegram bots who can provide this information like @userinfobot)
-
initialize the bot with your API key and user ID:
bot = Telexception("api_key", "user_id")
Also you can send traceback or log file:
bot = Telexception("api_key", "user_id", send_traceback=True, path_to_logs='path/to/logs.log')
Then, use the exception_handler decorator on any function you want to track:
@bot.exception_handler
def some_function_with_problems(*args, **kwargs):
pass
When some_function_with_problems raises an exception, a message will be sent to the specified Telegram chat.
License
This project is licensed under the terms of the MIT license.
Release files for telexception 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| telexception-1.0.0.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telexception-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.4 kB
Release files / telexception-1.0.0.tar.gz
| Download URL | telexception-1.0.0.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a519d923b03be56bbac43f52bab6bdd5a68acb8baa049aeedb5c74ab204cc41
|
|
BLAKE2b-256 checksum How to use checksums |
4625c68207219c0ac9170e173afad1f82243c401dae4ca4e28b4773e7e529cba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / telexception-1.0.0-py3-none-any.whl
| Download URL | telexception-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbe3a84ad016df9ba697c6634c89a1d357f351ab33b8bbe2aaa75cdc556daaa2
|
|
BLAKE2b-256 checksum How to use checksums |
e3742109befb145ff85cabe76678830156922aa24b9d242b5962432c564c0c04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|