Package: cues
CuesElegant and sophisticated prompts to inquire and ask questions at the command line.CompatibilityWindowsmacOSLinux✔✔✔InstallationYou can install Cues by usingpip:pip install cuesExamplesSelectYou can use theSelectclass to create a prompt that asks the user to select a single option among a list of them, allowing the user to shuffle through them by using the arrow keys.If you would like to to see an example of this in action, you can run the following command in your terminal:python -m cues.selectHere's some example code showing how you could create aSelectprompt:fromcuesimportSelectname='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:ConfirmYou can use theConfirmclass to create a prompt that displays a message to the user and then asks them to enter y (Yes) or N (No).If you would like to to see an example of this in action, you can run the following command in your terminal:python -m cues.confirmHere's some example code showing how you could create aConfirmprompt:fromcuesimportConfirmname='continue'message='Are you sure you want to continue?'cue=Confirm(name,message)answer=cue.send()print(answer)This produces the following output:FormYou can use theFormprompt to display a series of fields for the user to answer and fill out.If you would like to to see an example of this in action, you can run the following command in your terminal:python -m cues.formHere's some example code showing how you could create aFormprompt:fromcuesimportFormname='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:SurveyYou can use theSurveyclass to display a series of questions to the user and have them give a rating based on a scale that you provide.If you would like to to see an example of this in action, you can run the following command in your terminal:python -m cues.surveyHere's some example code showing how you could create aSurveyprompt:fromcuesimportSurveyname='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:CheckboxYou can use theCheckboxclass to give a user a list of options and have them select as many as they would like by using the spacebar.If you would like to to see an example of this in action, you can run the following command in your terminal:python -m cues.checkboxHere's some example code showing how you could create aCheckboxprompt:fromcuesimportCheckboxname='guitars'message='Pick your favorite guitars:'options=['Les Paul','Stratocaster','Telecaster','SG','Flying V','Acoustic','Classical',]cue=Checkbox(name,message,options)answer=cue.send()print(answer)This produces the following output:PasswordYou can use thePasswordclass when you need input from the user but would prefer their input be hidden while they type as it may contain sensitive information.If you would like to to see an example of this in action, you can run the following command in your terminal:python -m cues.passwordfromcuesimportPasswordname='password'message='Password:'cue=Password(name,message)answer=cue.send()print(answer)This produces the following output:To DoJSON promptCheckbox promptPassword prompt...amongst other things!