Python: CatchException
With Python's try-except statement, experience a significantly more flexible way to receive notifications. You can receive alerts through various messaging platforms such as email, Slack, and Discord. This package offers an extensive range of notification options to suit your needs.
Python package CatchException can give a single line alarm with an error message, whereas knockknock gives a process ending alarm with decorator and cli.
Quick Start
CatchException installation
pip insall catchexception
Features
Mail
In the except statement, an email is sent along with the error message. Additionally, you can send emails from any desired line.
a. Log in with the sender's email ID.
b. Obtain an app password for sending Google Mail at the following link.
from CatchException import ExceptionMail, SuccessMail, SendMail
sys.excepthook = ExceptionMail.__call__
try:
main() # Your Code Here
SuccessMail().__call__() # No Exception -> Send Success mail.
except ExceptionMail: # Exception -> Send Fail mail.
pass
SendMail().__call__() # When Process Ended -> Any Line mail.
See Example...
import sys
from CatchException import ExceptionMail, SuccessMail
# 01. Set variable.
global gmail_receiver, gmail_sender, gmail_app_password_of_sender, SendMail
gmail_receiver = 'parkminwoo1991@gmail.com'
gmail_sender = 'heydudenotice@gmail.com'
gmail_app_password_of_sender = 'xxxxxxxxxxx'
sys.excepthook = ExceptionMail.__call__
try:
# 02. Locate your code.
print(1/0)
SuccessMail().__call__() # Success Mail
# Exception Mail
except ExceptionMail as e:
sys.exit()
print(e)
SendMail().__call__() # Put Any Line: Sending mail
Metadata
Release files for catchexception 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| catchexception-0.1.0.tar.gz | 5.3 kB | Without provenance | Details for catchexception-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| catchexception-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for catchexception-0.1.0-py3-none-any.whl |
Total release size: 11.5 kB
Release files / catchexception-0.1.0.tar.gz
| Download URL | catchexception-0.1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4908895647585e5dd25d9ed3ea0c5508f2341ed04f5350349265a2ca239abb8
|
|
BLAKE2b-256 checksum How to use checksums |
c6a5da3d66a96b4c34b96c64d15b069cfb866819b2a52005e0013880a726da0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.12
|
Release files / catchexception-0.1.0-py3-none-any.whl
| Download URL | catchexception-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d19963a9960b34c935029a4cd90aa2e50adb99f80dac39986459f98295bd98c9
|
|
BLAKE2b-256 checksum How to use checksums |
cbbd89ffe6394dbefcaad68a3e39ace68ad0b73127109fa413079dbfce3c1f42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.12
|
Security for catchexception 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.