Skip to main content

vanta

Vanta

A lightweight Python toolkit for clean, structured CLI output.

Vanta provides a simple Console class with:

  • Colored messages
  • Timestamps
  • Log levels
  • stdout/stderr separation
  • Typed input and confirmations
  • Exception handling
  • Cross-platform terminal clearing
  • Automatic color detection
  • Interactive and non-interactive support

Installation

pip install vanta

Then:

import vanta

console = vanta.Console()

Quick Start

console.info("Hello, world!")
console.success("Operation completed.")
console.warning("Something might be wrong.")
console.error("Something went wrong.")
console.notice("Please take note.")

Output:

[16:42:10] [INFO] Hello, world!
[16:42:10] [SUCCESS] Operation completed.
[16:42:10] [WARNING] Something might be wrong.
[16:42:10] [ERROR] Something went wrong.
[16:42:10] [NOTICE] Please take note.

Colors are automatically enabled when supported.

Console

console = vanta.Console()

Common options:

console = vanta.Console(
    color=False,
    cls=True,
    level="info",
)
Option Default Description
color None Enable, disable, or auto-detect colors
cls False Clear the terminal on startup
interactive None Enable or disable interactive input
level "info" Minimum log level
stdout sys.stdout Normal output stream
stderr sys.stderr Warning/error stream

Logging

Vanta supports seven message levels:

console.debug("Debug information.")
console.info("Information.")
console.notice("Take note.")
console.success("Operation completed.")
console.warning("Something may be wrong.")
console.error("Something went wrong.")
console.critical("Critical failure.")

Warnings, errors, and critical messages are written to stderr.

Log Levels

Messages can be filtered:

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

Only warning, error, and critical messages will be displayed.

Available levels:

debug
info
notice
success
warning
error
critical

Raw Output

Use raw() for output without a message variant:

console.raw("Hello!")

By default, it includes a timestamp.

console.raw("Hello!", timestamp=False)
Hello!

User Input

ask() converts input using any callable:

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

Custom validation works too:

def parse_name(value: str) -> str:
    value = value.strip()

    if not value:
        raise ValueError

    return value.title()


name = console.ask("Name:", parse_name)

Retries can be configured:

age = console.ask(
    "Age:",
    int,
    retry=3,
)

Use retry=None for unlimited retries.

Confirmation

Use confirm() for yes/no prompts:

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

The default is True:

Continue? [Y/n]

To default to False:

console.confirm(
    "Delete this file?",
    default=False,
)

Custom aliases are supported:

console.confirm(
    "Continue?",
    alias_yes={"sure"},
    alias_no={"cancel"},
)

Exceptions

Display exceptions easily:

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

For a full traceback:

console.exception(
    exc,
    traceback=True,
)

Terminal

Clear the terminal:

console.clear()

Vanta handles Windows, Linux, and macOS automatically.

The detected terminal width is available through:

console.width

Colors

Colors are automatically detected.

Disable them explicitly:

console = vanta.Console(color=False)

Vanta also respects:

NO_COLOR=1 vanta

and:

FORCE_COLOR=1 vanta

Non-Interactive Mode

Vanta can be used without interactive input:

console = vanta.Console(
    interactive=False,
)

This is useful for scripts, CI, and automated environments.

API

Console

Console(
    color: bool | None = None,
    cls: bool = False,
    *,
    stream=None,
    stdout=None,
    stderr=None,
    input_fn=input,
    interactive: bool | None = None,
    level: str = "info",
)

Messages

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

Other

console.raw(message, timestamp=True)
console.clear()
console.exception(exc, traceback=False, prefix=None)
console.ask(...)
console.confirm(...)

Version

0.2.0 - Console & CLI Improvements

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

License

See LICENSE for license information.

Release files for vanta 0.2.0

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.2.0
File Size Uploaded
vanta-0.2.0.tar.gz 19.3 kB Details

Built distribution (wheel)

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

Total release size: 33.1 kB

Release files / vanta-0.2.0.tar.gz

Download URL vanta-0.2.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
84e01b9a536712171a4432a6168b57f6b68d5838ce22e9401ca4d3282075f1d6
BLAKE2b-256 checksum
How to use checksums
bc2c3b26119832b82a8d5d4100d86f87b73e0e88ac1a6a0df5ee3f5465720a80
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 17, 2026.

Transparency log

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

Download URL vanta-0.2.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
767c1ab5eeb5835c1659393a87a7bf7d98abe20f98ba58d11f75047dcd53d450
BLAKE2b-256 checksum
How to use checksums
236ff064412f5c6565157f3c42af2bf6e077b3856a96a3ec1f0a613e72810b7c
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 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.0 This release

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