Metadata-Version: 2.4
Name: askput
Version: 0.1.4
Summary: 🎯 Simple and safe console input validation for Python
Author-email: Basil S <bbbbasil1739@gmail.com>
Maintainer-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: 🐛 Bug Tracker, https://github.com/1-basil/askput/issues
Project-URL: 📖 Documentation, https://github.com/1-basil/askput#readme
Project-URL: 💬 Discussions, https://github.com/1-basil/askput/discussions
Keywords: input,validation,console,cli,user-input,type-checking,input-validation,beginner-friendly,safe-input,askput
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Classifier: Environment :: Console
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
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.

