Ever get tired of fine-tuning user input?
Well, this is the package for you!
At least it is for me since I made the whole thing in the first place...
Python 3.11.x or newer.
pip install angets
Import Module.
import angetsBasic usage, One attempt with a prompt to the user.
input0 = angets.get_non_empty_string('Give me a response! ')To get inputs with a bit more control.
Remember to set
verboseto True as no warning will be conveyed to the user otherwise.
input1 = angets.get_constrained_float(
within=(6, 9),
interval='[]',
prompt='Now give me a number within said range!',
warning="Oops! Not within the bounds I'm afraid...",
verbose=True,
attempts=10
)That is the gist of the main features.
It should be a useful utility tool to mitigate against invalid user inputs.
Actually, I don't expect anyone else other than me to use this package.
But if you find it useful enough to want to contribute, be my guest!