Skip to main content

FastDebugger

FastDebugger is a debugging tool for Python that allows users to quickly and easily print the values of variables in their code. To use FastDebugger, users simply call the fd() function and pass it the variables they want to print. FastDebugger will then print the variable name, value and other useful information. This can be helpful for quickly checking the values of variables and troubleshooting code.

GitHub release (latest by date) Working status Working Python version PyPI - License

Contents

Author

Installation

Install using pip

  pip install FastDebugger

  pip3 install FastDebugger

Call variables

fd(*args:Any, nl:bool=True)

The fd() call can take in any variables as arguments. It does not matter what type the variables are or how many there are. FastDebugger will print the type and value of each variable passed to it.

The nl parameter determines if a newline is printed after the fd() call.

Examples

Input:

from FastDebugger import fd

fd = FastDebugger()

lst = [123, True, 'Hello world!']

fd(lst, nl=True)
print('Foo')
fd(lst, nl=False) # Default value of `nl` is False
print('Foo')

Output:

fd |  list |  3  | lst
 ╟ |  int  |  0  | 123
 ╟ |  bool |  1  | True
 ╚ |  str  |  2  | 'Hello world!'

Foo
fd |  list |  3  | lst
 ╟ |  int  |  0  | 123
 ╟ |  bool |  1  | True
 ╚ |  str  |  2  | 'Hello world!'
Foo

How to use

Basic example

Input:

from FastDebugger import fd

def foo(x, y, z):
    result = x + y + z
    fd(x, y, z, result)

foo(1, 2, 3)

Output:

fd |  int  | x: 1
fd |  int  | y: 2
fd |  int  | z: 3
fd |  int  | result: 6

Output format:

fd | {variable type} | {variable name}: {variable value}

Lists, sets, tuples and dictionarys

Input:

from FastDebugger import fd
from random import randint

def bar(n):
    lst = [randint(0, n) for _ in range(n)]
    dct = {f'key_{i}': randint(0, n) for i in range(n)}
    tpl = tuple(randint(0, n) for _ in range(n))
    st = {randint(0, n) for _ in range(n)}

    fd(lst, st, tpl, dct, nl=True)

bar(5)

Output:

fd |  list |  5  | lst
 ╟ |  int  |  0  | 4
 ╟ |  int  |  1  | 5
 ╟ |  int  |  2  | 3
 ╟ |  int  |  3  | 5
 ╚ |  int  |  4  | 4

fd |  set  |  3  | st
 ╟ |  int  |  0  | 0
 ╟ |  int  |  1  | 2
 ╚ |  int  |  2  | 3

fd | tuple |  5  | tpl
 ╟ |  int  |  0  | 3
 ╟ |  int  |  1  | 5
 ╟ |  int  |  2  | 0
 ╟ |  int  |  3  | 3
 ╚ |  int  |  4  | 5

fd |  dict |  5  | dct
 ╟ |  int  |  0  | key_0: 0
 ╟ |  int  |  1  | key_1: 1
 ╟ |  int  |  2  | key_2: 1
 ╟ |  int  |  3  | key_3: 0
 ╚ |  int  |  4  | key_4: 3

Output format (list, set, tuple):

fd | {array type} | {array length} | {array name}
 ╚ | {variable type} | {index in array} | {variable value}

Output format (dictionary):

fd | dict | {dict length} | {dict name}
 ╚ | {value type} | {index in dict} | {key}: {value}

Numpy arrays

Input:

from FastDebugger import fd
import numpy as np

def bar(a, b):
    c = a * b
    d = np.sin(c)
    e = np.cos(d)
    f = np.tan(e)
    fd(a, b, c, d, e, f, nl=True)

bar(np.array([1, 2, 3]), np.array([4, 5, 6]))

Output:

fd | ndarray |  3  | a
 ╟ | int32 |  0  | 1
 ╟ | int32 |  1  | 2
 ╚ | int32 |  2  | 3

fd | ndarray |  3  | b
 ╟ | int32 |  0  | 4
 ╟ | int32 |  1  | 5
 ╚ | int32 |  2  | 6

fd | ndarray |  3  | c
 ╟ | int32 |  0  | 4
 ╟ | int32 |  1  | 10
 ╚ | int32 |  2  | 18

fd | ndarray |  3  | d
 ╟ | float64 |  0  | -0.7568024953079282
 ╟ | float64 |  1  | -0.5440211108893698
 ╚ | float64 |  2  | -0.7509872467716762

fd | ndarray |  3  | e
 ╟ | float64 |  0  | 0.7270351311688124
 ╟ | float64 |  1  | 0.8556343548213666
 ╚ | float64 |  2  | 0.7310155667453406

fd | ndarray |  3  | f
 ╟ | float64 |  0  | 0.8895922779758605
 ╟ | float64 |  1  | 1.1513517113559995
 ╚ | float64 |  2  | 0.8967481047747234

Output format (exactly like lists, sets...):

fd | {array type} | {array length} | {array name}
 ╚ | {variable type} | {index in array} | {variable value}

Metadata

Release files for FastDebugger 0.0.43

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FastDebugger 0.0.43
File Size Uploaded
FastDebugger-0.0.43.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FastDebugger 0.0.43
File Interpreter ABI Platform
FastDebugger-0.0.43-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / FastDebugger-0.0.43.tar.gz

Download URL FastDebugger-0.0.43.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b001243bfabf61c736ad867fc67b3aba30a3e18e37a49e693ad090f1739fbef
BLAKE2b-256 checksum
How to use checksums
8e705a3637f6d7f05b328233855e0e9cc16701ccd098cb2393ee5efa615e01d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / FastDebugger-0.0.43-py3-none-any.whl

Download URL FastDebugger-0.0.43-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50a6ca9e2ddba20f119020334779ac79fbb3347209f9cf46c4cd571772b7da4d
BLAKE2b-256 checksum
How to use checksums
44d284eeb2116348808f2cd90912b4cdf91a84dd5fe21c564aabc9b21c3aa866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.43 This release

2 release files

0.0.41

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page