Skip to main content

Instant debugger alternative for python

Project description

Welcome to quickDebug!

QuickDebug 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 quickDebug is optimized for terminals supported colors (through termcolor), meaning it may not work on all CLIs.

Installation

>> python3 -m pip install quickerDebug

Quick Start

Initialization

To use the package, you need to create an instance of QuickDebug, 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

quickDebug 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 quickDebug 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

quickerDebug-0.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quickerDebug-0.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file quickerDebug-0.1.1.tar.gz.

File metadata

  • Download URL: quickerDebug-0.1.1.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

Hashes for quickerDebug-0.1.1.tar.gz
Algorithm Hash digest
SHA256 51fdbbe4a0cb8e60cb7c202f2c4025b4fd999282c9699172927cb716a0113cf5
MD5 dead5d2b5cbdc7308a42abab377e0c48
BLAKE2b-256 1f478eda71796c589394a9c197145c15fbab034cbb4d2679e9f49c07fedd1993

See more details on using hashes here.

File details

Details for the file quickerDebug-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: quickerDebug-0.1.1-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

Hashes for quickerDebug-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c6a75449d6b5ecb9ab8537fc285eb13fbfc12f0d274154d04f7f5b2126fce5a
MD5 e4ebb4c29d0ae959ce5e4a386a65b537
BLAKE2b-256 96fea3eba22e46578a617702ca91671d4630e7ff425f3ce0211a435c71441221

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page