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

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.0.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.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file userinputgetter-1.0.0.tar.gz.

File metadata

  • Download URL: userinputgetter-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 aa94143443303acdd5812cdbe30b5485ffba93e5f9015d3ec236021c0489e590
MD5 fb96151563c776d6b6f2631b6557eb41
BLAKE2b-256 f6ddab79230f0568033922c51f0c3d20d4d2c13fef486302a8be2453ac1cff62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for userinputgetter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff38418c7806048a6540dea10b27616a2aca913425ffb2c1e3ccff4fea948335
MD5 a9d20f8837952a7dddda5e954a938b4a
BLAKE2b-256 b96d08b3e8f292a3b504097dd3569a82d580275e37a3864c19f8f30b2a2e7f38

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