Metadata-Version: 2.4
Name: vanta
Version: 0.1.1
Summary: A lightweight Python toolkit for beautiful, structured CLI output.
Author: zscopuv
License: VANTA SOURCE-AVAILABLE LICENSE
        Version 1.0
        
        Copyright © 2026 radecekq
        All rights reserved.
        
        1. DEFINITIONS
        
        For the purposes of this License:
        
        "Software" means the Vanta software, including its source code, documentation,
        configuration files, assets, and any other materials distributed with the
        Software.
        
        "Original Software" means the Software as distributed by the Copyright Holder.
        
        "Modified Version" means any version of the Software that has been altered,
        adapted, translated, extended, refactored, or otherwise changed from the
        Original Software.
        
        "Copyright Holder" means the individual or entity that owns the copyright in
        the Software.
        
        "User" means any individual or organization obtaining access to the Software.
        
        "Redistribution" means providing, publishing, transmitting, selling,
        licensing, sublicensing, uploading, mirroring, or otherwise making the
        Software or a Modified Version available to any third party.
        
        
        2. GRANT OF RIGHTS
        
        Subject to the terms and conditions of this License, the Copyright Holder
        grants the User a limited, non-exclusive, non-transferable, revocable license
        to:
        
            a. access and inspect the source code of the Software;
        
            b. copy the Software for personal use and development;
        
            c. create private forks of the Software;
        
            d. modify, adapt, extend, or otherwise alter the Software;
        
            e. compile and execute the Software and Modified Versions for personal
               use; and
        
            f. use the Software and Modified Versions for non-commercial purposes.
        
        These permissions do not constitute a transfer of ownership or copyright.
        
        
        3. REDISTRIBUTION PROHIBITED
        
        The User may not, without prior written permission from the Copyright Holder:
        
            a. redistribute the Original Software;
        
            b. redistribute any Modified Version;
        
            c. publish a fork of the Software;
        
            d. publish source code derived from the Software;
        
            e. distribute compiled binaries or executable versions of the Software
               or a Modified Version;
        
            f. upload the Software or a Modified Version to another repository,
               package registry, download service, file-sharing service, or similar
               distribution platform;
        
            g. sell, sublicense, rent, lease, or otherwise transfer the Software or
               a Modified Version to another person or organization; or
        
            h. make the Software or a Modified Version publicly available through
               any medium.
        
        
        4. PRIVATE FORKS
        
        The User may create and maintain private forks of the Software for personal
        development, experimentation, testing, education, or other lawful purposes.
        
        A private fork must not be made available to third parties without the
        express written permission of the Copyright Holder.
        
        Nothing in this section grants permission to publish or redistribute a fork.
        
        
        5. MODIFICATIONS
        
        The User is expressly permitted to modify the Software for private use.
        
        Modifications may include, but are not limited to:
        
            - adding or removing functionality;
            - changing the user interface;
            - changing configuration;
            - fixing bugs;
            - refactoring code;
            - creating experimental features; and
            - adapting the Software for personal environments.
        
        However, the creation of a Modified Version does not grant the User any
        additional right to redistribute that Modified Version.
        
        
        6. COPYRIGHT AND OWNERSHIP
        
        The Software remains the property of the Copyright Holder.
        
        This License does not transfer ownership of the Software, its source code,
        copyright, trademarks, trade names, or other intellectual property rights.
        
        All rights not expressly granted by this License are reserved by the
        Copyright Holder.
        
        
        7. ATTRIBUTION
        
        If the Software or a Modified Version is used privately, the User is
        encouraged to preserve all existing copyright notices, license notices,
        author information, and attribution contained within the Software.
        
        Nothing in this License permits the removal of copyright notices for the
        purpose of claiming ownership of the Original Software.
        
        
        8. COMMERCIAL USE
        
        Commercial use, including incorporation of the Software into a commercial
        product or service, is not permitted unless expressly authorized in writing
        by the Copyright Holder.
        
        The Copyright Holder may grant separate commercial licenses at their
        discretion.
        
        
        9. REQUESTS FOR REDISTRIBUTION
        
        A User wishing to redistribute the Software or a Modified Version may
        contact the Copyright Holder and request explicit permission.
        
        Permission may be granted or denied at the sole discretion of the Copyright
        Holder.
        
        Any permission to redistribute may be subject to additional terms and
        conditions established by the Copyright Holder.
        
        
        10. NO WARRANTY
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE, TITLE, OR NON-INFRINGEMENT.
        
        THE COPYRIGHT HOLDER SHALL NOT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
        LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE
        OR OTHER DEALINGS IN THE SOFTWARE.
        
        
        11. LIMITATION OF LIABILITY
        
        TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE COPYRIGHT HOLDER
        SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL,
        OR EXEMPLARY DAMAGES ARISING FROM THE USE OR INABILITY TO USE THE SOFTWARE.
        
        
        12. TERMINATION
        
        This License automatically terminates if the User violates any of its terms.
        
        Upon termination, the User must cease all use of the Software and destroy
        copies of the Software and Modified Versions in their possession or control,
        except where retention is required by applicable law.
        
        Permissions may be reinstated only through explicit written authorization
        from the Copyright Holder.
        
        
        13. SEVERABILITY
        
        If any provision of this License is determined to be invalid or
        unenforceable, the remaining provisions shall remain in full force and
        effect.
        
        
        14. ENTIRE AGREEMENT
        
        This License constitutes the entire agreement concerning the Software and
        supersedes any prior or contemporaneous understanding concerning the rights
        granted under this License.
        
        
        15. RESERVATION OF RIGHTS
        
        The Copyright Holder reserves all rights not expressly granted by this
        License.
        
        No permission should be inferred merely because a particular restriction is
        not explicitly stated.
        
        
        16. LICENSE VERSION
        
        This license is designated:
        
            Vanta Source-Available License v1.0
        
        Future versions of this License may be published by the Copyright Holder.
        Unless explicitly stated otherwise, a particular version of the Software
        remains governed by the license version distributed with that version.
        
        
        Copyright © 2026 radecekq
        All rights reserved.
        
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: colorama==0.4.6
Requires-Dist: packaging>=24.0
Dynamic: license-file

![vanta](https://i.ibb.co/q3HFNJV1/image.jpg)
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:

```bash
pip install vanta
````

Then in your IDE:

```python
from vanta import Console
```

## Quick Start

```python
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:

```js
[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:

```python
console = vanta.Console()
```

By default, Vanta:

* Enables colors
* Clears the terminal when the console is created

Both behaviors can be configured:

```python
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

```python
console.info("This is an informational message.")
```

### Success

```python
console.success("Everything went well!")
```

### Warning

```python
console.warning("Be careful.")
```

### Error

```python
console.error("Something went wrong.")
```

### Notice

```python
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.

```python
console.raw("Hello!")
```

By default, the timestamp is still displayed.

To remove the timestamp:

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

Output:

```text
Hello!
```

---

## Clearing the Terminal

The terminal can be cleared manually:

```python
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.

```python
name = console.ask("What is your name:")
```

Since the default output type is `str`, this returns the entered text.

### Integers

```python
age = console.ask("How old are you:", int)
```

If the user enters:

```text
18
```

`age` will be an `int`.

Invalid input is automatically rejected:

```text
How old are you: abc
[16:45:21] [ERROR] Invalid. Please use int.
How old are you:
```

### Floating-point numbers

```python
price = console.ask("Enter the price:", float)
```

### Custom converters

`ask()` accepts any callable that takes a `str` and returns the desired type.

For example:

```python
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:

```python
age = console.ask(
    "Age:",
    int,
    "Please enter a valid number."
)
```

---

## Confirmation Prompts

Use `confirm()` for yes/no questions:

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

The default behavior is:

```text
Continue? [Y/n]
```

Pressing **Enter** accepts the default (`True`).

### Default to No

Set `default=False`:

```python
if console.confirm("Delete this file?", default=False):
    print("Deleting...")
```

The prompt becomes:

```text
Delete this file? [y/N]
```

Pressing **Enter** now returns `False`.

### Accepted Answers

Yes:

```text
y
1
ok
ye
yes
yep
yy
```

No:

```text
n
0
no
nah
nn
```

Input is case-insensitive.

### Custom Error Messages

```python
console.confirm(
    "Continue?",
    error_message="Please answer with yes or no."
)
```

---

## Disabling Colors

Colors can be disabled when creating the console:

```python
console = vanta.Console(color=False)
```

Output will then use plain text:

```text
[16:45:21] [INFO] Hello!
```

This can be useful when output is being redirected to a file or another program.

---

## API Reference

### `Console`

```python
Console(
    color: bool = True,
    cls: bool = True
)
```

### `clear()`

```python
console.clear() -> None
```

Clears the terminal.

### `info()`

```python
console.info(message: str) -> None
```

Prints an informational message.

### `success()`

```python
console.success(message: str) -> None
```

Prints a success message.

### `warning()`

```python
console.warning(message: str) -> None
```

Prints a warning message.

### `error()`

```python
console.error(message: str) -> None
```

Prints an error message.

### `notice()`

```python
console.notice(message: str) -> None
```

Prints a notice message.

### `raw()`

```python
console.raw(
    message: str,
    timestamp: bool = True
) -> None
```

Prints unclassified output.

### `ask()`

```python
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()`

```python
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.
