clinput

Useful command line input functions with error checking.


Keywords
command, line, input
License
MIT
Install
pip install clinput==1.0.2

Documentation

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

  1. Installation
  2. Usage
  3. Documentation
  4. Contributing
  5. Testing
  6. License

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

MIT