Skip to main content

Collection of common interactive command line user interfaces, based on Inquirer.js

Project description

TESTS

COVERAGE

Travis results

Coveralls results_

Collection of common interactive command line user interfaces, based on Inquirer.js.

Goal and Philosophy

Born as a Inquirer.js clone, it shares part of the goals and philosophy.

So, Inquirer should ease the process of asking end user questions, parsing, validating answers, managing hierarchical prompts and providing error feedback.

You can download the python-inquirer code from GitHub or download the wheel from Pypi.

Documentation

Documentation has been moved to ReadTheDocs.

But here you have a couple of usage examples:

Text

import inquirer
questions = [
  inquirer.Text('name', message="What's your name"),
  inquirer.Text('surname', message="What's your surname"),
  inquirer.Text('phone', message="What's your phone number",
                validate=lambda x, _: re.match('\d+', x),
                )
]
answers = inquirer.prompt(questions)

Example of Text Question

List

Shows a list of choices, and allows the selection of one of them.

Example:

import inquirer
questions = [
  inquirer.List('size',
                message="What size do you need?",
                choices=['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'],
            ),
]
answers = inquirer.prompt(questions)

Example of List Question

Checkbox

Shows a list of choices, with multiple selection.

Example:

import inquirer
questions = [
  inquirer.Checkbox('interests',
                    message="What are you interested in?",
                    choices=['Computers', 'Books', 'Science', 'Nature', 'Fantasy', 'History'],
                    ),
]
answers = inquirer.prompt(questions)

Example of Checkbox Question

License

Copyright (c) 2014 Miguel Ángel García (@magmax9), based on Inquirer.js, by Simon Boudrias (@vaxilart)

Licensed 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

inquirer-2.1.11.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

inquirer-2.1.11-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file inquirer-2.1.11.tar.gz.

File metadata

  • Download URL: inquirer-2.1.11.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for inquirer-2.1.11.tar.gz
Algorithm Hash digest
SHA256 802d6e790e209799d24810f205cc819e6a150db683444a15815f95c361aba2de
MD5 45b1c0482b65c8cfdd0cd43dee9878f1
BLAKE2b-256 d9b8cf5a337682d7fb1191585bf1b2f7162925590dee4d60f5ade721e2ab0d6c

See more details on using hashes here.

File details

Details for the file inquirer-2.1.11-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for inquirer-2.1.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bf5763e9bb6b1e7f9b96a09db6ba41e5da2943724f41428441595a1f6752b032
MD5 d11528c1919fa61af89f7abb6a7c8542
BLAKE2b-256 6bb03f96e09e090d6945641c420c881bbe7dd40e2918f2a5ee8c96f4bd0db900

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