Metadata-Version: 2.4
Name: askput
Version: 0.1.2
Summary: Simple and safe console input validation
Author-email: Basil S <bbbbasil1739@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/1-basil/askput
Project-URL: Repository, https://github.com/1-basil/askput
Project-URL: Issues, https://github.com/1-basil/askput/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# askput

**askput** is a lightweight Python library for safe, validated, and interactive console input.

It removes repetitive input-validation logic and helps you build clean, readable CLI programs with minimal effort.

---

## Why askput?

Python’s built-in `input()`:

- always returns strings  
- provides no validation  
- leads to repeated `try / except` blocks  

askput offers a clean abstraction over these problems while staying simple and dependency-free.

---

## Features

- Integer and float input with bounds
- String length validation
- Email validation
- Secure password input
- Strong password rules
- Yes/No confirmations
- Phrase-based confirmation for dangerous actions
- Menu-based choice selection
- Regex (pattern) based input
- Multiple values input
- Fully tested with `pytest`
- Zero external dependencies

---

## Installation

``` bash
pip install askput
```

Usages
---
Basic Usage
---
```python

from askput import ask

age = ask.int("Enter age", min=18)
price = ask.float("Enter price", min=0)
name = ask.string("Enter name", min_len=2)
email = ask.email("Enter email")

print(age, price, name, email)
```
Passwords and Confirmations
---
```python
from askput import ask

age = ask.int("Enter age", min=18)
price = ask.float("Enter price", min=0)
name = ask.string("Enter name", min_len=2)
email = ask.email("Enter email")

print(age, price, name, email)

```
```python
from askput import ask

password = ask.password("Enter password")
strong_password = ask.password_strong("Create strong password")

confirm = ask.confirm("Continue?")
delete = ask.confirm_phrase("Type DELETE to continue", "DELETE")

```
Choice / Menu Input
---

```python
from askput import ask

role = ask.choice(
    "Select role",
    ["Admin", "User", "Guest"]
)

print("Selected role:", role)
```
##Pattern and Multiple Input
---
```python
from askput import ask

code = ask.pattern("Enter code", r"^[A-Z]{3}\d{3}$")
tags = ask.multi("Enter tags (comma separated)")

print(code, tags)
```
Example: Simple CLI Flow
---
```python
from askput import ask

role = ask.choice("Role", ["Admin", "User"])
age = ask.int("Age", min=18)
password = ask.password_strong("Password")

if ask.confirm("Submit form?"):
    print("Form submitted")
```
Testing
---
askput is fully tested using pytest.

```bash
pytest
```

All tests are before every release.

