Useful command line input functions with error checking.
Project description
Clinput
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.
Contents
Installation
Install using pip
:
pip install clinput
Usage
It is recommended to import each of single
and multi
separately (to avoid confusion) as follows:
import clinput.single as clis
# example use:
input_var = clis.positive("Enter a positive number: ")
or:
import clinput.single as clim
# example use:
input_vars = clim.positive("Enter a list of positive number inputs: ")
Documentation
Documentation can be found at Read the Docs.
Contributing
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.
Testing
Tests are run using pytest
.
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.