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

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.1

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

License

See LICENSE.

Release files for vanta 0.3.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 vanta 0.3.1
File Size Uploaded
vanta-0.3.1.tar.gz 23.4 kB Details

Built distribution (wheel)

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

Total release size: 40.4 kB

Release files / vanta-0.3.1.tar.gz

Download URL vanta-0.3.1.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f1db1fe51eff8f65fd942397c721399fbd66214789d1a83656fe3410b0ca04fc
BLAKE2b-256 checksum
How to use checksums
fe6f1dbfa4e5bbedb162e2d713c315a88a25d4367cfa12e64fd566f61638e456
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 20, 2026.

Transparency log

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

Download URL vanta-0.3.1-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e2e7e1ff253881330deba829025845f886581990387daca6c25f4ae5329b39d
BLAKE2b-256 checksum
How to use checksums
fe8f344acb6b4940b15f2b137f61f5bbcc97d9b22d2619760350ef3683480cdd
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 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.2

2 release files

This release

0.3.1 This release

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