Useful command line input functions with error checking.
Clinput is an importable python package that contains tools to create command line user inputs with data type conversion, syntax checking and customizable error messages. Syntactically, the functions in this package are similar to Python default input function, with a variety of optional arguments to provide customizable performance.
pip install clinput
It is recommended to import each of
multi separately (to avoid confusion) as follows:
import clinput.single as clis # example use: input_var = clis.positive("Enter a positive number: ")
import clinput.single as clim # example use: input_vars = clim.positive("Enter a list of positive number inputs: ")
Documentation can be found at Read the Docs.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Tests are run using
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.