Skip to main content

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

Project description

VERSION

DOWNLOADS

TESTS

COVERAGE

Latest PyPI version

Number of PyPI downloads

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.3.tar.gz (12.9 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.3-py2-none-any.whl (25.9 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for inquirer-2.1.3.tar.gz
Algorithm Hash digest
SHA256 634e8786a5c0cb2394f0d842e019af76378220b746f5bae9f267bf81546ea887
MD5 f4562e48def1c751d91d6fb9d5570d35
BLAKE2b-256 6917b727b1e9e366ef5e3eebbf6da10910c8ff4abfcbd708073d93ea98f52d45

See more details on using hashes here.

File details

Details for the file inquirer-2.1.3-py2-none-any.whl.

File metadata

File hashes

Hashes for inquirer-2.1.3-py2-none-any.whl
Algorithm Hash digest
SHA256 f1e689b4311afbac10089ee1c4f01b6fa555374163e97a4acf0aa384c10582e6
MD5 c460fb220434f6ca235c27768c81d467
BLAKE2b-256 4a71f5b91d37270ec193c1e65d5ff91f9a0957d35e8100071c85e2526baa6e01

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