Skip to main content

varview

A tiny, zero-dependency debug-printing helper for people who check their work, for clean automation.

from varview import debug

count = 42
total = 137
status = "active"

debug(["count", "total", "status"])
count: 42

total: 137

status: active

Why this exists

Most debugging habits start the same way: print(f"count: {count}"), scattered through a script, forgotten about, and left in, or worse, silently shaping a result nobody meant to ship.

varview was built out of a data analyst's day-to-day discipline: if you can't see your intermediate values clearly, you can't trust your final ones. Threshold sweeps, fold splits, feature combos, backtest tables: every step that touches a metric is a step where leakage, silent type coercion, or an off-by-one slice can quietly corrupt a result. The habit that catches this isn't a debugger or a notebook full of stray print() calls, it's making every checkpoint visible, on purpose, every time, with a single flip to turn it all off before anything ships.

That's the whole philosophy behind this package:

  • See it before you trust it. Print the name and the value, side by side, with no risk of the label drifting out of sync with what it's labeling.
  • Validate loudly, not quietly. Every parameter is checked up front; bad input fails fast with a clear error instead of producing a confusing result three functions later.
  • Make leakage a choice, not an accident. One global switch silences every debug call in a file at once, so nothing you used to sanity-check a fold split or a train/test boundary can slip into a shared notebook or a production run by accident.

Install

pip install varview

Usage

Basic

from varview import debug

count = 42
debug(["count"])       # list of names
debug("count")          # a single string also works, no need to wrap it

Color-code by what the value means to you

debug(["count"], color="green")   # default, all good
debug(["count"], color="yellow")  # worth a second look
debug(["count"], color="red")     # flag it

Lay it out the way you're scanning

debug(["count", "total", "status"])                     # vertical (default)
debug(["count", "total", "status"], orientation="horizontal")  # count: 42, total: 137, status: active

Turn one call off without deleting it

debug(["count"], display=False)

Turn every call off at once, before you share or ship

from varview import debug_off, debug_on

debug_off()   # every debug() call in the process goes silent, even display=True ones
# ... run the rest of your pipeline, notebook export, whatever needs to be clean ...
debug_on()    # back to normal for your next debugging session

debug_off() is the one-line answer to "did I leave a debug print in this notebook before I sent it to someone." Flip it at the top of a cell, or right before a scheduled job runs, and every debug() call downstream goes quiet, no hunting through the file for calls you forgot about.

Typos don't kill the whole block

debug(["count", "totall", "status"])
# count: 42
# totall: <not found>
# status: active

One bad name prints <not found> in place instead of raising and losing every other value you wanted to see.

API

debug(names, color="green", display=True, orientation="vertical")

Param Type Default Notes
names str or list/tuple of str (required) Variable names to look up in the caller's local scope
color "green", "red", "yellow" "green" Label color only; values always print in black
display bool True Silences this one call when False
orientation "vertical", "horizontal" "vertical" Layout of the printed pairs

All four parameters are validated on every call: an invalid color or orientation raises ValueError, an invalid display type raises TypeError, and names must be a string or a list/tuple of strings or it raises TypeError. Nothing gets a chance to fail silently or print something misleading.

debug_off() / debug_on()

Module-level switch. debug_off() silences every debug() call in the running process, regardless of that call's own display value. debug_on() restores normal behavior.

License

MIT

Metadata

Release files for varview 0.1.1

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

Source distribution (sdist)

Source distribution for varview 0.1.1
File Size Uploaded Provenance
varview-0.1.1.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 12.9 kB

Release files / varview-0.1.1.tar.gz

Download URL varview-0.1.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1e0447ef7b69cf78504d036bba2081191e6ac5b7dc77b355bfd458e1c24a2e92
BLAKE2b-256 checksum
How to use checksums
c99b180e0f58cc42b79c973a2773b80e0a65a4e38f4a26cc7e9abd66e285c5f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / varview-0.1.1-py3-none-any.whl

Download URL varview-0.1.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58bae74c6b4048d648b3cfb8cdfe641e88b869fed28e15891d022c962b0ccb9e
BLAKE2b-256 checksum
How to use checksums
510d993dedc17cc1b267929934a7cb02b1f754b8ad3ff8511cd6240adab36e66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for varview 0.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.

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