Skip to main content

A simple lightweight library to avoid writting common input checks

Project description

valid_input

valid_input is a lightweight Python library for performing commonly used input checks like make the user inputs a valid int or float or an especific option

Installation

You can install input_tools using pip:

pip install valid_input

Usage

from valid_input import input_int, input_float, input_option

age = input_int("Introduce your age: ")
height = input_float("What's your height? (in meters): ")
sex = input_option("What's your sex? (male/female/other)", ["male", "female", "other"])

# At this point, you can be sure that:
#  age variable is an integer
#  height variable is a float
#  sex variable is one of three options on the list

License

valid_input is distributed under the MIT License.

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

valid_input-0.0.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

valid_input-0.0.1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file valid_input-0.0.1.tar.gz.

File metadata

  • Download URL: valid_input-0.0.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.0

File hashes

Hashes for valid_input-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d241acd9a84aa2265426076344c983f1c43b3659b0dca8ace99a8504254d175a
MD5 bbe80750321a7a911af1fa2c15033ac9
BLAKE2b-256 43ce21a4355cd5db45eea690f7549fc6b9420e64d32c0b94f76d66a1da64041c

See more details on using hashes here.

File details

Details for the file valid_input-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: valid_input-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.0

File hashes

Hashes for valid_input-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a062508e3e01beabb4561a0bc7f5e0b5e35c9775d4d16c25d0e4e29044a7ec
MD5 088ffe08f36e0e78f41a0a084fe58609
BLAKE2b-256 03f70b1906e952bed48ffde916be526cf631c1c0c96a6c6207c7d0d5fdec751d

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