Provides an interface, and several implementations, of classes which continuously request command-line user input until a valid response has been attained, and parse the output as a desired type
Project description
UserInputGetter
This package provides an interface, and several implementations, of classes which continuously request command-line user input until a valid response has been attained, and parse the output as a desired type.
The input is checked for validity (for example if a date is expected, the input must match one of several supported date regular expressions), and optionally a user may specified an iterable of supported options, in which case the user input must be parsable as one of the specified options.
The implementations provide two main methods for interacting with user input. The first is get_value(), and the second is get_multiple_values(), which parses multiple user inputs when provided as a comma-separated list
The abstract base class is called UserInputGetter, and the following implementations are provided:
Implementations
IntegerInputGetterCaseInsensitiveStringInputGetterDateInputGetter
Download from the Python Package Index
pip install userinputgetter- https://pypi.org/project/userinputgetter/1.0.0/
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 userinputgetter-1.1.0.tar.gz.
File metadata
- Download URL: userinputgetter-1.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fd4c826439888e421bafda8bd1c186b0cf5be579d0e5713fe124357dcd75b90
|
|
| MD5 |
664b4e4db4421acfab02366676323c7a
|
|
| BLAKE2b-256 |
1bc1dfa1e2b51e66b8f238e09dba16980e34b334de3fcad2c87d58bcf090dac0
|
File details
Details for the file userinputgetter-1.1.0-py3-none-any.whl.
File metadata
- Download URL: userinputgetter-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e9b3c42197822e8e34cef1c0fa463fd4e8519e892fcf50986a05c68a770795a
|
|
| MD5 |
af1c5845531649844f037dc9d3be1548
|
|
| BLAKE2b-256 |
f59b9b2d3b43ae1999a38c49664d7c264a8df8c20b64cb557f5a3ac926a0cc4c
|