Skip to main content

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

  • IntegerInputGetter
  • CaseInsensitiveStringInputGetter
  • DateInputGetter

Download from the Python Package Index

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

userinputgetter-1.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

userinputgetter-1.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for userinputgetter-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1fd4c826439888e421bafda8bd1c186b0cf5be579d0e5713fe124357dcd75b90
MD5 664b4e4db4421acfab02366676323c7a
BLAKE2b-256 1bc1dfa1e2b51e66b8f238e09dba16980e34b334de3fcad2c87d58bcf090dac0

See more details on using hashes here.

File details

Details for the file userinputgetter-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for userinputgetter-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e9b3c42197822e8e34cef1c0fa463fd4e8519e892fcf50986a05c68a770795a
MD5 af1c5845531649844f037dc9d3be1548
BLAKE2b-256 f59b9b2d3b43ae1999a38c49664d7c264a8df8c20b64cb557f5a3ac926a0cc4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page