A simple lightweight library to avoid writting common input checks
Project description
valid_input
valid_input is a lightweight Python library for performing commonly used input checks like make the user inputs a valid int or float or an especific option
Installation
You can install input_tools using pip:
pip install valid_input
Usage
from valid_input import input_int, input_float, input_option
age = input_int("Introduce your age: ")
height = input_float("What's your height? (in meters): ")
sex = input_option("What's your sex? (male/female/other)", ["male", "female", "other"])
# At this point, you can be sure that:
# age variable is an integer
# height variable is a float
# sex variable is one of three options on the list
License
valid_input is distributed under the MIT License.
Project details
Release history Release notifications | RSS feed
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 valid_input-0.0.1.tar.gz.
File metadata
- Download URL: valid_input-0.0.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d241acd9a84aa2265426076344c983f1c43b3659b0dca8ace99a8504254d175a
|
|
| MD5 |
bbe80750321a7a911af1fa2c15033ac9
|
|
| BLAKE2b-256 |
43ce21a4355cd5db45eea690f7549fc6b9420e64d32c0b94f76d66a1da64041c
|
File details
Details for the file valid_input-0.0.1-py3-none-any.whl.
File metadata
- Download URL: valid_input-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5a062508e3e01beabb4561a0bc7f5e0b5e35c9775d4d16c25d0e4e29044a7ec
|
|
| MD5 |
088ffe08f36e0e78f41a0a084fe58609
|
|
| BLAKE2b-256 |
03f70b1906e952bed48ffde916be526cf631c1c0c96a6c6207c7d0d5fdec751d
|