Skip to main content

Argparse for input(): enables easy validation of user inputs

Project description

Input Parser

The input-parser module allows you to easily write scripts requiring user interaction.

The input function allows you to define the response it expects from the user so it can parse out any incorrect responses and request a new one. It automatically generates failure messages for the user.

Compatibility

input-parser is being developed with Python 3.8, but is likely to work on older versions (and will be tested when completed).

Installation

This package currently isn't on PyPi so cannot be installed. This will be available soon. In the meantime, simply copy the src/input-parser/parser.py file to your project.

Usage

The module contains only one function called parse_input(). This has two required arguments, the message and the type. The message will be shown to the user when requesting an input. The class represents the type of the input required. At the moment, you can only specify one type, but I plan to allow more to be set in a future update.

Bugs

If you find a bug in input-parser, probably just create a GitHub issue, bearing in mind that this is still a work in progress, so I've probably already spotted the bug but haven't got around to fixing it.

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

input-parser-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file input-parser-0.1.0.tar.gz.

File metadata

  • Download URL: input-parser-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for input-parser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0912a5b6fe80e75e7fc1927075f341410c48d9bc721446db173a015e212bea31
MD5 ca07a6a850bf9196314bbb9e212cdd96
BLAKE2b-256 56b01470a86f453d1042b161e1639bf67a2b9e169cbb65a1f0ab817457f17d57

See more details on using hashes here.

Supported by

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