Skip to main content

Easy input validation for python

Installation

pip install ask

Usage

>>> from ask import ask, askChar, askInt, askString, askPassword, askEmail, askBool, explain
>>> ask()
# Creates an empty input query here

>>> askInt('Your age')
Your age
# Input here (Only accepts integers)

>>> askString("What's your name?")
What's your name?
# Input here

>>> askChar('Do you want to proceed?', ['y','n'])
Do you want to proceed? (y/n)
# Input here (Only accepts 'y' and 'n')

>>> askChar('Do you want to install this?', ['y','n'], 'y')
Do you want to install this? (y/n) [y]
# Input here (Only accepts 'y' and 'n', you can hit enter to use the default 'y')

>>> askBool('Do you want to continue?')
Do you want to continue (y/n)
# Input here (automatically generates the possibilites 'y' and 'n')

>>> askEmail()
# Input here (only accepts email-adresses)

>> askPassword()
# Masked input here

>> explain()
# Prints explanation:
Attention: Input prompts follow this template:
"Question (answer1, answer2, answer3) [default_answer]"
(You can just hit enter to chose the default answer)

Release files for melebeats 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for melebeats 0.3
File Size Uploaded
melebeats-0.3.tar.gz 2.6 kB Details

Release files / melebeats-0.3.tar.gz

Download URL melebeats-0.3.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0c7d09ca7846fd8d9979fb3f19cec8a03d1bdb9c851cb8bb7cc8c534a7beaaaa
BLAKE2b-256 checksum
How to use checksums
9f7e6cabb34de3759bb26527346a705a70dba9106aa1407dd81804d4255e6dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page