sweetdebug - Feel easy to debug
Automatic pdb invoker, Telegram support
Install
pip install sweetdebug
or (To use Telegram notification)
pip install sweetdebug[telegram]
Main Feature
- Use the CLI command to debug any Python script without modifying the source:
sweetdebug your_script.py [script arguments...]
- Or just add one(or two) line in your code:
from sweetdebug import sweetdebug
sweetdebug()
1/0 # Error !!
- This will invoke pdb automatically.
Traceback (Most recent call last):
3 /main.py <module> --> 1/0
ZeroDivisionError: division by zero
> /main.py(3)<module>()
-> 1/0
(Pdb)
Other feature(s)
- You can receive error message with Telegram, too.
- To get Telegram authentication token, See Telegram Botfather for details.
# Assume you have Telegram tokens and corresponding chat ids.
token = "123456789:ABCDEF_VGRXDZKwvHS8@Xca5e2EnZdfsgTw"
chat_ids = ["13852425", '29384594']
sweetdebug(telegram=True, telegram_api_token=token, chat_ids=chat_ids)
1/0 # Error !!
- Also, If you have used your tokens and chat ids, then you can use cached token and chat ids.
sweetdebug(telegram=True)
Other feature(s) - 2 (Added from 1.0.8)
- sweettimer : simple timer for a code snippets
from sweetdebug import sweettimer
# simple timer for a function
@sweettimer()
def xxx1():
return sum([i for i in range(1000)])
# replace function name or time units
@sweettimer(name="my_xxx", unit="ms")
def xxx2():
return sum([i for i in range(1000)])
# also supports context-level
with sweettimer():
sum([i for i in range(1000)])
xxx1()
xxx2()
# you can also check elapsed times through this class attribute
print(sweettimer.times)
(/home/jongho/workspace/testbed/timer.py, line 15) :: elapsed 0.01293182373046875 s
(/home/jongho/workspace/testbed/timer.py)[xxx1] :: elapsed 2.288818359375e-05 s
(/home/jongho/workspace/testbed/timer.py)[my_xxx] :: elapsed 0.019788742065429688 ms
[(None, 0.011715888977050781, 's'), ('xxx1', 2.09808349609375e-05, 's'), ('my_xxx', 1.6927719116210938e-05, 'ms')]
Metadata
Release files for sweetdebug 1.1.1
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 |
|---|---|---|---|---|
| sweetdebug-1.1.1.tar.gz | 5.4 kB | Without provenance | Details for sweetdebug-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sweetdebug-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for sweetdebug-1.1.1-py3-none-any.whl |
Total release size: 11.6 kB
Release files / sweetdebug-1.1.1.tar.gz
| Download URL | sweetdebug-1.1.1.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d27933cf4a02066cf1cca210ad1074bde5469fc048cb88bc9183766db0bbd892
|
|
BLAKE2b-256 checksum How to use checksums |
d53801e470eef72251cdbc7bdf2c7569abafb6192c4592558dc633269ec5f775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / sweetdebug-1.1.1-py3-none-any.whl
| Download URL | sweetdebug-1.1.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69a851905e5611f7cca425be947372e4d20d1f17fdde2d2a11aec9ed57a25216
|
|
BLAKE2b-256 checksum How to use checksums |
33e2767fc019d4d9f45eac879faf6db8bc8a40bfe71c6870be116043fc40fab1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for sweetdebug 1.1.1
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.