Package: quo
Forever ScalableQuois a toolkit for writing Command-Line Interface(CLI) applications and a TUI (Text User Interface) framework for Python.Quo is making headway towards composing speedy and orderly CLI and TUI applications while forestalling any disappointments brought about by the failure to execute a python application.
Simple to code, easy to learn, and does not come with needless baggage.CompatibilityQuo works flawlessly  with Linux, OSX, and Windows.
Quo requires Python3.8or later.FeaturesSupport for Ansi, RGB and Hex color modelsSupport for tabular presentation of dataIntuitive progressbarsCode completionsNesting of commandsCustomizable Text User Interface(TUI)dialogs.Automatic help page generationSyntax highlightingAutosuggestionsKey BindersGetting StartedInstallationYou can install quo via the Python Package Index (PyPI)pip install -U quoIn order to check your installation you can usepython -m pip show quoRun the following to test Quo output on your terminal:python -m quo:bulb: pressCtrl-cto exitQuo LibraryQuo contains a number of builtin features you c
an use to create elegant output in your CLI.Quo echoTo output formatted text to your terminal you can import theechomethod.
Try this:Example 1fromquoimportechoecho("Hello, World!",fg="red",italic=True,bold=True)Example 2fromquoimportechoecho("Blue on white",fg="blue",bg="white")Alternatively, you can importprintExample 1fromquoimportprintprint('<b>This is bold</b>')print('<i>This is italic</i>')Example 2fromquoimportprintprint('<u>This is underlined</u>')Example 3fromquoimportprintprint("Quo is <style bg='red'>Scalable</style>")Example 4# Colors from the ANSI palette.print('<red>This is red</red>')print('<style fg="white" bg="green">White on green</stlye>')Quo promptUsingquo.promptmethod.fromquo.promptimportpromptprompt("What is your name?")Usingquo.prompt.PromptobjectExample 1fromquo.promptimportPromptsession=Prompt()session.prompt("Type something:")Example 2Colored Promptfromquo.promptimportPromptsession=Prompt()session.prompt("<red>Type something: </red>")Example 3Example upgradefromquo.promptimportPromptsession=Prompt(fg="blue")#The input will be colored bluesession.prompt("<red>john</red><white>@</white><green>localhost</green><red>:</red><cyan><u>/user/john</u></cyan><purple>$ </purple>")Example 4Bottom toolbarfromquo.promptimportPromptsession=Prompt()session.prompt('> ',bottom_toolbar="<i>This is a</i><b><style bg='red'> Toolbar</style></b>")Example 5Here's an example of a multiline bottom toolbar.fromquo.promptimportPromptsession=Prompt()session.prompt("Say something: ",bottom_toolbar="This is\na multiline toolbar")Example 6Placeholder textA placeholder  text that's displayed as long as no input s given.:bulb: This won't be returned as part of the output.fromquo.promptimportPromptsession=Prompt()session.prompt("What is your name?: ",placeholder='<gray>(please type something)</gray>')Example 7Coloring the prompt.fromquo.promptimportPromptsession=Prompt(fg="red")session.prompt("Type something: ")Example 8Autocomplete textPress [Tab] to autocompletefromquo.promptimportPromptfromquo.completionimportWordCompleterexample=WordCompleter(['USA','UK','Canada','Kenya'])session=Prompt(completer=example)session.prompt('Which country are you from?: ')Example 9Autosuggest textAuto suggestion is a way to propose some input completions to the user. Usually, the input is compared to the history and when there is another entry starting with the given text, the completion will be shown as gray text behind the current input.
Pressing the right arrow → or ctrl-e will insert this suggestion, alt-f will insert the first word of the suggestion.fromquo.historyimportMemoryHistoryfromquo.promptimportPromptMemoryHistory.append("import os")MemoryHistory.append('print("hello")')MemoryHistory.append('print("world")')MemoryHistory.append("import path")session=Prompt(history=MemoryHistory,suggest="history")whileTrue:session.prompt('> ')Read more onPromptQuo BarDraw a horizontal bar with an optional title, which is a good way of dividing your terminal output in to sections.fromquo.barimportBarbar=Bar("I am a bar")bar.draw()Styled barfromquo.barimportBarbar=Bar("I am a styled bar")bar.draw(fg="blue",bg="yellow")Right alignedfromquo.barimportBarbar=Bar("I am right aligned")bar.draw(align="right")Quo ConsoleFor more control over quo terminal content, import and construct aConsoleobject.Launching ApplicationsQuo supports launching applications throughConsole.launchExample 1fromquo.consoleimportConsoleconsole=Console()console.launch("https://quo.rtfd.io/")Example 2fromquo.consoleimportConsoleconsole=Console()console.launch("/home/path/README.md",locate=True)Spin🔁Quo can create a context manager that is used to display a spinner on stdout as long as the context has not exitedimporttimefromquo.consoleimportConsoleconsole=Console()withconsole.spin():time.sleep(3)print("Hello, World")Read more onConsoleQuo DialogsHigh level API for displaying dialog boxes to the user for informational purposes, or to get input from the user.Example 1Message Box dialogfromquo.dialogimportMessageBoxMessageBox(title='Message window',text='Do you want to continue?\nPress ENTER to quit.')Example 2Input dialogfromquo.dialogimportInputBoxInputBox(title='PromptBox Shenanigans',text='What Country are you from?:')Multiline Input dialogfromquo.dialogimportInputBoxInputBox(title='PromptBox Shenanigans',text='What Country are you from?:',multiline=True)Password Input dialogfromquo.dialogimportInputBoxInputBox(title='PromptBox Shenanigans',text='What Country are you from?:',hide=True)Radiolistfromquo.dialogimportRadiolistBoxRadiolistBox(title="RadioList dialog example",text="Which breakfast would you like ?",values=[("breakfast1","Eggs and beacon"),("breakfast2","French breakfast"),("breakfast3","Equestrian breakfast")])Read more onDialogsQuo Key Binding🔐A key binding is an association between a physical key on akeyboard and a parameter.fromquoimportechofromquo.keysimportbindfromquo.promptimportPromptsession=Prompt()# Print "Hello world" when ctrl-h is pressed@bind.add("ctrl-h")def_(event):echo("Hello, World!")session.prompt("")Read more onKey bindingsQuo ParserYou can parse optional and positional arguments with Quo and generate help pages for your command-line tools.fromquo.parseimportParserparser=Parser(description="This script prints hello NAME COUNT times.")parser.argument('--count',default=3,type=int,help='number of greetings')parser.argument('name',help="The person to greet")arg=parser.parse()forxinrange(arg.count):print(f"Hello{arg.name}!")$pythonprog.pyJohn--count4And what it looks like:Here's what the help page looks like:$pythonprog.py--helpRead more onParserQuo ProgressBarCreating a new progress bar can be done by calling the classProgressBarThe progress can be displayed for any iterable. This works by wrapping the iterable (likerange) with the classProgressBarimporttimefromquo.progressimportProgressBarwithProgressBar()aspb:foriinpb(range(800)):time.sleep(.01)Read more onProgressQuo RuleUsed for drawing a horizontal line.Example 1fromquo.ruleimportRulerule=Rule()rule.draw()Example 2A styled line.fromquo.ruleimportRulerule=Rule()rule.draw(color="purple")Example 3A multicolored line.fromquo.ruleimportRulerule=Rule()rule.draw(multicolored=True)Quo TablesThis offers a number of configuration options to set the look and feel of the table, including how borders are rendered and the style and alignment of the columns.Example 1fromquo.tableimportTabledata=[["Name","Gender","Age"],["Alice","F",24],["Bob","M",19],["Dave","M",24]]table=Table(data)table.print()Example 2Right aligned tablefromquo.tableimportTabledata=[["Name","Gender","Age"],["Alice","F",24],["Bob","M",19],["Dave","M",24]]table=Table(data)table.print(align="right")Example 3Colored tablefromquo.tableimportTabledata=[["Name","Gender","Age"],["Alice","F",24],["Bob","M",19],["Dave","M",24]]table=Table(data)table.print(fg="green")Example 4Column widthIn situations where fields are expected to reasonably be too long to look good as a single line, parametercolumn_widthcan help automate word wrapping long fields.fromquo.tableimportTabledata=[[1,'John Smith','This is a rather long description that might look better if it is wrapped a bit']]table=Table(data)table.print(headers=("Issue Id","Author","Description"),column_width=[None,None,30])Example 5Grid tablefromquo.tableimportTabledata=[["Name","Gender","Age"],["Alice","F",24],["Bob","M",19],["Dave","M",24]]table=Table(data)table.print(theme="grid")Read more onTableQuo WidgetsA collection of reusable components for building full screen applications.FrameUsed draw a border around any container, optionally with a title.Read more onFrameLabelWidget that displays text.Read more onLabelBox + Labelfromquoimportcontainerfromquo.boximportBoxfromquo.labelimportLabelcontent=Label("Hello, World!",fg='red',bg='yellow')container(content)Read more onWidgetsFor more intricate  examples, have a look in theexamplesdirectory and the documentation.Donate🎁In order to for us to maintain this project and grow our community of contributors.DonateQuo is...SimpleIf you know Python you can  easily use quo and it can integrate with just about anything.Getting HelpCommunityFor discussions about the usage, development, and the future of quo, please join our Google communityCommunity👨‍👩‍👦‍👦ResourcesBug trackerIf you have any suggestions, bug reports, or annoyances please report them
to our issue tracker atBug trackeror send an email to:📥scalabli@googlegroups.com|scalabli@proton.meBlogs💻→ How to build CLIs usingquoLicense📑This software is licensed under theMIT License. See theLicensefile in the top distribution directory for the full license text.Code of ConductCode of Conduct is adapted from the Contributor Covenant,
version 1.2.0 available atCode of Conduct