MCPcopy Index your code
hub / github.com/Sobolev5/simple-print

github.com/Sobolev5/simple-print @v2.2.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.8 ↗ · + Follow
13 symbols 68 edges 9 files 8 documented · 62%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Simple print

Local development tool for logs printing.

https://github.com/Sobolev5/simple-print

Install

To install run:

pip install simple-print

sprint

Print variables with its names:

master = "yoda" # variable name master
sprint(master) 
sprint(master, c="magenta") 
sprint(master, c="white", b="on_blue") 
sprint(master, c="blue", b="white", a="underline") 
sprint(master, c="blue", b="on_white", a="bold", p=True) 
master_as_s = sprint(master, s=True) # return as string
master_as_s_with_path = sprint(master, s=True, p=True) # return as string with path to file 

c color [grey, red, green, yellow, blue, magenta, cyan, white].
b background [on_grey, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan].
a attribute [bold, dark, underline, blink, reverse, concealed].
p path [True/False] with path to file.
l light [True/False] print without fn name and lineno (shortcut lsprint).
i indent [1..40].
s string [True/False] return as string.
r return [True/False] print and return as string.
f force print [True/False] ignore SIMPLE_PRINT_ENABLED=False for docker production logs for example.
stream output stream [stdout, stderr, null]. stdout by default. null means no print.

Example with indent

Indent print:

def test_indent():
    fruits = ["lemon", "orange", "banana"]
    sprint(fruits, c="green")  
    for fruit in fruits:
        sprint(fruit, c="yellow", i=4)

lsprint

Light version of sprint.

master = "yoda" # variable name master
lsprint(master)

SprintErr

Minified error traceback.

from simple_print import SprintErr

@patch("logging.info", MagicMock(side_effect=[Exception("Something went wrong")]))
def test_sprint_err(self):
   with SprintErr(l=30):
      logging.info("")

spprint

Pretty print with indent.

from simple_print import sprrint

spprint(
   {"hello": c"world", "lorem": "ipsum"}, 
   i=20,
)

Env

Stop printing on production:

export SIMPLE_PRINT_ENABLED=False

Test

pytest -s

Core symbols most depended-on inside this repo

sprint
called by 21
simple_print/sprint.py
lsprint
called by 21
simple_print/sprint.py
_colorize
called by 2
simple_print/sprint.py
_print
called by 2
simple_print/sprint.py
spprint
called by 1
simple_print/spprint.py
SprintErr
called by 1
simple_print/sprint_err.py
format_exception
called by 1
simple_print/sprint_err.py

Shape

Function 10
Class 1
Method 1
Route 1

Languages

Python100%

Modules by API surface

simple_print/sprint.py4 symbols
tests/test_sprint_err.py3 symbols
tests/test_sprint.py2 symbols
simple_print/sprint_err.py2 symbols
tests/test_spprint.py1 symbols
simple_print/spprint.py1 symbols

For agents

$ claude mcp add simple-print \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page