A lightweight Python toolkit for beautiful, structured CLI output.
Vanta provides a simple Console class for building clean command-line interfaces with:
- Colored log messages
- Timestamps
- Cross-platform terminal clearing
- Typed user input
- Yes/no confirmation prompts
- Optional color output
- Optional automatic screen clearing
Installation
From source
Clone the repository:
pip install vanta
Then in your IDE:
from vanta import Console
Quick Start
import vanta
console = vanta.Console()
console.info("Hello, world!")
console.success("Operation completed.")
console.warning("Something might be wrong.")
console.error("Something went wrong.")
console.notice("Please take note.")
Example 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.
When colors are enabled, each message type is displayed with its own color.
Console
Create a console instance with:
console = vanta.Console()
By default, Vanta:
- Enables colors
- Clears the terminal when the console is created
Both behaviors can be configured:
console = vanta.Console(
color=False,
cls=False,
)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
color |
bool |
True |
Enable or disable colored output |
cls |
bool |
True |
Clear the terminal when initialized |
Logging
Vanta provides five message variants.
Info
console.info("This is an informational message.")
Success
console.success("Everything went well!")
Warning
console.warning("Be careful.")
Error
console.error("Something went wrong.")
Notice
console.notice("Please take note of this.")
All messages include a timestamp.
Raw Output
Use raw() when you want to output a message without a variant prefix.
console.raw("Hello!")
By default, the timestamp is still displayed.
To remove the timestamp:
console.raw("Hello!", timestamp=False)
Output:
Hello!
Clearing the Terminal
The terminal can be cleared manually:
console.clear()
Vanta automatically uses the appropriate command for the operating system:
- Windows:
cmd /c cls - Linux/macOS:
clear
User Input
The ask() method allows you to request and convert user input.
name = console.ask("What is your name:")
Since the default output type is str, this returns the entered text.
Integers
age = console.ask("How old are you:", int)
If the user enters:
18
age will be an int.
Invalid input is automatically rejected:
How old are you: abc
[16:45:21] [ERROR] Invalid. Please use int.
How old are you:
Floating-point numbers
price = console.ask("Enter the price:", float)
Custom converters
ask() accepts any callable that takes a str and returns the desired type.
For example:
def parse_name(value: str) -> str:
value = value.strip()
if not value:
raise ValueError
return value.title()
name = console.ask("Name:", parse_name)
Custom error messages
You can provide your own error message:
age = console.ask(
"Age:",
int,
"Please enter a valid number."
)
Confirmation Prompts
Use confirm() for yes/no questions:
if console.confirm("Continue?"):
print("Continuing...")
The default behavior is:
Continue? [Y/n]
Pressing Enter accepts the default (True).
Default to No
Set default=False:
if console.confirm("Delete this file?", default=False):
print("Deleting...")
The prompt becomes:
Delete this file? [y/N]
Pressing Enter now returns False.
Accepted Answers
Yes:
y
1
ok
ye
yes
yep
yy
No:
n
0
no
nah
nn
Input is case-insensitive.
Custom Error Messages
console.confirm(
"Continue?",
error_message="Please answer with yes or no."
)
Disabling Colors
Colors can be disabled when creating the console:
console = vanta.Console(color=False)
Output will then use plain text:
[16:45:21] [INFO] Hello!
This can be useful when output is being redirected to a file or another program.
API Reference
Console
Console(
color: bool = True,
cls: bool = True
)
clear()
console.clear() -> None
Clears the terminal.
info()
console.info(message: str) -> None
Prints an informational message.
success()
console.success(message: str) -> None
Prints a success message.
warning()
console.warning(message: str) -> None
Prints a warning message.
error()
console.error(message: str) -> None
Prints an error message.
notice()
console.notice(message: str) -> None
Prints a notice message.
raw()
console.raw(
message: str,
timestamp: bool = True
) -> None
Prints unclassified output.
ask()
console.ask(
question: str,
output: Callable[[str], T] = str,
error_message: str | None = None
) -> T
Prompts the user for input and converts it using output.
confirm()
console.confirm(
question: str,
error_message: str | None = None,
default: bool = True
) -> bool
Prompts the user for a yes/no response.
Version
Current version: 0.1.1
Vanta is currently in early development. The API may change between releases before reaching a stable 1.0.0 release.
License
See LICENSE for license information.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vanta-0.1.1.tar.gz.
File metadata
- Download URL: vanta-0.1.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2df68c7e31b08017ef11308df6066663f06736eff82c1b18e9789a444bab126e
|
|
| MD5 |
c5faea3dcde3db5873332d851ad6b382
|
|
| BLAKE2b-256 |
ebe128e1729ebef6b0cee77c05ed258976e1d700b08639acc6baca8196104d5c
|
Provenance
The following attestation bundles were made for vanta-0.1.1.tar.gz:
Publisher:
publish.yml on zscopuv/vanta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vanta-0.1.1.tar.gz -
Subject digest:
2df68c7e31b08017ef11308df6066663f06736eff82c1b18e9789a444bab126e - Sigstore transparency entry: 2833926638
- Sigstore integration time:
-
Permalink:
zscopuv/vanta@562007ae19dd9a9b8ba03d6819e9b3faea07886f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/zscopuv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@562007ae19dd9a9b8ba03d6819e9b3faea07886f -
Trigger Event:
release
-
Statement type:
File details
Details for the file vanta-0.1.1-py3-none-any.whl.
File metadata
- Download URL: vanta-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0403b35436f70fb86d44e3cb16907d83be3a0437663702e6a5aee8e796f268cd
|
|
| MD5 |
2c4a5628a2bd12f0e5f22dea46f20440
|
|
| BLAKE2b-256 |
2548ec2b47b67d823a14e419d38149832f050f7eaf857d3c3f609bf66a6ad74e
|
Provenance
The following attestation bundles were made for vanta-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on zscopuv/vanta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vanta-0.1.1-py3-none-any.whl -
Subject digest:
0403b35436f70fb86d44e3cb16907d83be3a0437663702e6a5aee8e796f268cd - Sigstore transparency entry: 2833926728
- Sigstore integration time:
-
Permalink:
zscopuv/vanta@562007ae19dd9a9b8ba03d6819e9b3faea07886f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/zscopuv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@562007ae19dd9a9b8ba03d6819e9b3faea07886f -
Trigger Event:
release
-
Statement type: