Skip to main content

vanta

Vanta

A lightweight Python toolkit for clean, structured CLI output.

  • Colored messages
  • Timestamps & log levels
  • Input & confirmations
  • Exception handling
  • Terminal utilities
  • Automatic color detection
  • Interactive / non-interactive mode
  • Simple terminal tables
  • Elapsed time measurement
  • Timer pause and resume

Installation

pip install vanta

Quick Start

import vanta

console = vanta.Console()

console.info("Hello, World!")

table = vanta.Table("Name", "Age", "Status")
table.add_row("Alice", 17, "Online")
table.print()

Console

console = vanta.Console(
    color=None,        # Auto-detect colors
    cls=False,         # Don't clear the terminal on startup
    *,
    stdout=None,       # Output stream for normal messages
    stderr=None,       # Output stream for warnings/errors
    interactive=None,  # Auto-detect interactive mode
    level="info",      # Minimum log level
)

Options

Option Description
color Enable/disable colors
cls Clear terminal on startup
stdout Output stream for normal messages
stderr Output stream for warnings/errors
interactive Enable/disable input
level Minimum log level

Log Levels

Vanta provides 7 log levels:

Level Value Stream Purpose
debug 10 stdout Detailed debugging information
info 20 stdout General information
notice 25 stdout Important information worth noting
success 30 stdout Successful operation
warning 40 stderr Something may be wrong
error 50 stderr An operation failed
critical 60 stderr Serious/critical failure

Lower levels are more verbose.

  • level="info" suppresses debug messages
  • level="warning" only emits warning, error, and critical

Examples

Logging

console.debug("Debug")
console.info("Info")
console.notice("Notice")
console.success("Success")
console.warning("Warning")
console.error("Error")
console.critical("Critical")

Set a minimum log level:

console = vanta.Console(level="warning")

For example, level="warning" only emits warning, error, and critical messages.

Input

name = console.ask("Name:")
age = console.ask("Age:", int)

if console.confirm("Continue?"):
    print("Continuing!")

ask() supports custom converters and retries.

Exceptions

try:
    1 / 0
except Exception as exc:
    console.exception(exc)

Use traceback=True for the full traceback.

Terminal

console.clear()

print(console.width)

Vanta works on Windows, Linux, and macOS.

Colors can also be controlled with NO_COLOR and FORCE_COLOR.

Methods

console.debug(...)
console.info(...)
console.notice(...)
console.success(...)
console.warning(...)
console.error(...)
console.critical(...)

console.raw(...)
console.ask(...)
console.confirm(...)
console.exception(...)
console.clear(...)

Tables

table = vanta.Table(
    "Name",        # Column 1
    "Age",         # Column 2
    "Status",      # Column 3
    ...,
    align="left",  # Align cell text to the left
    border=True,   # Show table and cell borders
    header=True,   # Include column headers
)

Options

Option Description
align Align cell text
border Show table and cell borders
header Include column headers

align can be left, center, or right.

Examples

table = vanta.Table("Name", "Age", "Status")

table.add_row("Alice", 17, "Online")
table.add_row("Bob", 21, "Offline")

table.print()

Output:

┌───────┬─────┬─────────┐
│ Name  │ Age │ Status  │
├───────┼─────┼─────────┤
│ Alice │ 17  │ Online  │
│ Bob   │ 21  │ Offline │
└───────┴─────┴─────────┘

Methods

table.add_row(...)
table.add_rows(...)
table.clear()
table.render()      # Returns the table as a string
table.print()       # Renders and prints the table

Progress

progress = vanta.Progress(
    100,
    label="Downloading",
    width=30,
    interactive=True,
)

Progress renders a single updating progress bar in the terminal.

Options

Option Description
total Total number of steps
label Text displayed before the bar
width Width of the progress bar
interactive Enable/disable terminal rendering
file Output stream for the progress bar

Examples

Basic

import time
import vanta

progress = vanta.Progress(100, label="Downloading")

while not progress.finished:
    time.sleep(0.02)
    progress.update()

Output:

Downloading [██████████████████████████████] 100.00% (100/100) 2.0s

The progress bar updates in place rather than printing a new line for every update.

Custom Updates

progress = vanta.Progress(100, label="Processing")

while not progress.finished:
    do_some_work()
    progress.update(5)

Progress is automatically capped at total.

Context Manager

with vanta.Progress(100, label="Downloading") as progress:
    while not progress.finished:
        do_some_work()
        progress.update()

Manual Finish

progress = vanta.Progress(100, label="Working")

progress.start()

# Do some work...

progress.finish()

Properties

Property Description
total Total number of steps
current Current progress
percentage Progress as a percentage
remaining Number of remaining steps
finished Whether the progress has finished
completed Whether the total has been reached
running Whether the progress is currently running
elapsed Elapsed time in seconds

Methods

progress.start()
progress.update()
progress.update(5)
progress.finish()
progress.reset()

Timer

timer = vanta.Timer(
    autostart=False,  # Don't start the timer immediately
)

Options

Option Description
autostart Start the timer immediately

Examples

Basic

import time
import vanta

timer = vanta.Timer(autostart=True)

time.sleep(1.5)

timer.stop()

print(timer.elapsed)
print(timer.ms)

Pause

from time import sleep

from vanta import Timer


timer = Timer(autostart=True)

sleep(1.525)

timer.stop()  # Optional, but recommended

print(timer.elapsed)  # Around 1.525 sec
print(timer.ms)       # Around 1525 ms

Paused time is not included in the elapsed time.

Context Manager

with vanta.Timer() as timer:
    time.sleep(2)

print(timer.elapsed)

Properties

Property Description
elapsed Elapsed active time in seconds
ms Elapsed active time in milliseconds
running Whether the timer is running
paused Whether the timer is paused
start_time Time when the timer was started
stop_time Time when the timer was stopped

Methods

timer.start()
timer.stop()
timer.pause()
timer.unpause()
timer.reset() # Clears the timer and returns it to its initial state. Does not restart.

Version

0.3.2

Vanta is currently in early development and the API may change before 1.0.0.

License

See LICENSE.

Release files for vanta 0.3.2

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

Source distribution (sdist)

Source distribution for vanta 0.3.2
File Size Uploaded
vanta-0.3.2.tar.gz 26.3 kB Details

Built distribution (wheel)

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

Total release size: 45.5 kB

Release files / vanta-0.3.2.tar.gz

Download URL vanta-0.3.2.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
116fd5c66be158e4b7ee6d9917747b760a008c69ac1f67d31377e83a492607b1
BLAKE2b-256 checksum
How to use checksums
15ed060f92e5418bd5b6403809939d138c1f060c366a50c08c199e57b4a1390a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / vanta-0.3.2-py3-none-any.whl

Download URL vanta-0.3.2-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8633ac2b43651b5280fe3d7ae5eead303436e1e40e88f4f311fca5b8561656f2
BLAKE2b-256 checksum
How to use checksums
045533fd9ff9ca552341bf824e1c10167a7e4ddf5d398fd3171905c3a698e2d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

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