Instant debugger alternative for python
Project description
Welcome to quickerDebug!
QuickerDebug offers a standardized alternative to print("here") and print(my_var) with simple, quick, and efficient logging functions that provide information without the need to repeat yourself. Generally, the best use case is for small scale applications or test code, where a complete debugger is overkill, but print("here") can get overly tedious to repeatedly type. Function names are purposefully shortened avoid writing out long function calls, so you don't waste time while debugging.
Note that quickerDebug is optimized for terminals supported colors (through termcolor), meaning it may not work on all CLIs.
Installation
>> pip install quickerDebug
Quick Start
Initialization
To use the package, you need to create an instance of QuickerDebug, from which methods can be called.
from quickerDebug import quickerDebug
qd = quickerDebug.QuickerDebug()
Basic Logging
The two essential functions for logging are qd.p() and qd.v().
# Logs index, line number, timestamp, and a optional message
qd.p()
# qd.p() also supports positional arguments for extra functionality like so:
qd.p(status="DEBUG", msg="", color=None, showFullPath=False, **kwargs)
# ie
qd.p("INFO", "First Test", "blue", True)
# Logs all variables with thier current values
qd.v()
# Variables are displayed inline
qd.v(inline=True)
AutoVar Configs
AutoVar configs allow you to set up a list of varibles with a certain format to be printed with current values with the qd.vc() function, and then allows you to access that printing configuration with qd.v(config_key).
a = 1
b = 2
# Create a config that prints the variables a and b, where the config_key is 1
qd.vc(1, "a", "b")
# Would print just a & b
qd.v(1) # config_key is the first argument
Variable Tracking
quickerDebug also provides lightweight, real-time variable tracking in the terminal through qd.track() and qd.rt()
a = 1
# Would print the value of a every 10ms for 5s
qd.track("a", 10, 5)
# Would clear the terminal after each print
qd.track("a", 10, 5, autoclear=True)
# Preset Function for indefinite real-time tracking
qd.rt("a")
Additional Keyword Arguments
All quickerDebug functions can take certain keyword arguments, as shown below:
| Function | Kwargs |
|---|---|
qd.p() |
status : str |
qd.p() & qd.v() |
showFullPath : bool |
qd.p() & qd.v() |
color : str (from colors in termcolor) |
qd.p() |
msg : str |
qd.v() |
inline : bool |
qd.track() & qd.rt() |
autoclear : bool |
| Kwarg | Possible Values |
|---|---|
status |
"OFF", "O", "ERROR", "ERR", "E", "WARNING", "WARN", "W", "DEBUG", "D", "INFO", "I", "TRACE", "T" |
color |
"grey", "red", "green", "yellow", "blue", "magenta", "cyan", "white" |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quickerDebug-0.1.3.tar.gz.
File metadata
- Download URL: quickerDebug-0.1.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdac60b23d976f4b94aa8c48c8c2373259194773c5c43bf5b8c1a124bf3fb3b3
|
|
| MD5 |
259e0c39f14e4efb5c48d8ca7b288048
|
|
| BLAKE2b-256 |
c5e098326452561a2725d945e7882e9d7f13a5973cc7badd9445a4089563dd3c
|
File details
Details for the file quickerDebug-0.1.3-py3-none-any.whl.
File metadata
- Download URL: quickerDebug-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1255821faa8e44b9e170b743c19ffcce26eaf342087a78b2e0adb1242685754
|
|
| MD5 |
eadab3eee58ba7b28464d10d85e43575
|
|
| BLAKE2b-256 |
9d6c8c4d35ab815e3cca707da1114a3fc7e57169fbf10966d82926c35d3818a5
|