Skip to main content

Elegant and sophisticated prompts to inquire and ask questions at the command line.

Project description

Cues

Python Version PyPI Development Status GitHub Workflow Status codecov License

Elegant and sophisticated prompts to inquire and ask questions at the command line.

Compatibility

Windows macOS Linux

Installation

You can install Cues by using pip:

pip install cues

Examples

Select

from cues import Select


name = 'programming_language'
message = 'Which of these is your favorite programming language?'
options = ['Python', 'JavaScript', 'C++', 'C#']

cue = Select(name, message, options)
answer = cue.send()
print(answer)

This produces the following output:

Confirm

from cues import Confirm


name = 'continue'
message = 'Are you sure you want to continue?'

cue = Confirm(name, message)
answer = cue.send()
print(answer)

This produces the following output:

Form

from cues import Form


name = 'basic_info'
message = 'Please fill out the following form:'
fields = [
    {
        'name': 'first_name',
        'message': 'What is your first name?',
        'default': 'Giovanni'
    },
    {
        'name': 'last_name',
        'message': 'What is your last name?',
        'default': 'Salinas'
    },
    {
        'name': 'birthday',
        'message': 'What is your favorite programming language?'
    }
]

cue = Form(name, message, fields)
answer = cue.send()
print(answer)

This produces the following output:

Survey

from cues import Survey


name = 'customer_satisfaction'
message = 'Please rate your satisfaction with the following areas:'
scale = [1, 2, 3, 4, 5]
fields = [
    {
        'name': 'customer_service',
        'message': 'Customer service'
    },
    {
        'name': 'restaurant_service',
        'message': 'Restaurant service'
    },
    {
        'name': 'bar_service',
        'message': 'Bar service'
    },
    {
        'name': 'room_service',
        'message': 'Room service'
    }
]

cue = Survey(name, message, scale, fields)
answer = cue.send()
print(answer)

This produces the following output:

To Do

  • Bring support to macOS
  • Bring support to Linux
  • JSON prompt
  • Checkbox prompt

...amongst other things!

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

cues-0.1.1.tar.gz (18.5 kB view hashes)

Uploaded Source

Built Distribution

cues-0.1.1-py3-none-any.whl (22.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page