A simple library for creating beautiful interactive prompts.
Project description
✨ A simple library for creating beautiful interactive prompts.
import survey
name = survey.input('Username: ')
password = survey.password('Password: ')
actions = ('Call', 'Text', 'Exit')
index = survey.select(actions, 'Chose an action: ')
# if index == 0: elif index == 1: else: ...
contacts = ('Squig', 'Zelan', 'Momo', 'Hamberg', 'Evan', 'Vonnie', 'Dwalon', 'Hacen')
indexes = survey.select(contacts, 'Select recipients: ', multi = True)
message = survey.input('Type messsage: ', multi = True)
confirm = survey.confirm(f'Message is {len(message)} characters long. Send? ', default = True)
Features
Pythonic: friendly interface wrapped around simple functions.
Lightweight: independent of any other prompt or visual libraries.
Adaptable: works with any string formatting and window size.
Extensive: packed with tweaks and features for any situation.
Installing
pip3 install survey
Links
Greatly inspired by AlecAivazis’s GoLang library.
Suggestions and contributions are greatly appreciated!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
survey-2.0.6.tar.gz
(15.2 kB
view details)
File details
Details for the file survey-2.0.6.tar.gz
.
File metadata
- Download URL: survey-2.0.6.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 862ca3e5f7570f574329fdc8b1e041cface8fe9302ba05b6cf23c95a5a3d94ef |
|
MD5 | 215a5a7e3fb78454f924aabe11c44c01 |
|
BLAKE2b-256 | 838e80b7518b4b88742bf75744c9c8bc5bb252861beefa56ac2d79501ef63107 |