# Questo
**Questo** is not your ordinary library of CLI elements; It's a framework. It's modular, extensible, Pythonic and brain friendly. You can build your own CLI elements, with custom key-press handling, validation and rendering, all in plain old Python; No magic.
## Basic Usage
```python
from questo import select, prompt
from yakh import get_key
selector = select.Select()
selector.state = select.SelectState(
title="Who's your favorite Teletubbie",
options=["Tinky Winky", "Dipsy", "Laa-Laa", "Po", "The Weird Vacuum Thing"],
selected=4
)
with selector.displayed():
while True:
selector.state = select.key_handler(selector.state, get_key())
if selector.state.exit or selector.state.abort:
break
prompter = prompt.Prompt()
prompter.state = prompt.PromptState(
title=f"Why {selector.result}?",
)
with prompter.displayed():
while True:
prompter.state = prompt.key_handler(prompter.state, get_key())
if prompter.state.exit or prompter.state.abort:
break
print(f"Ah, of course: {prompter.result}")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/petereon/questo",
"name": "questo",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.7.8",
"maintainer_email": null,
"keywords": "python",
"author": "Peter Vyboch",
"author_email": "pvyboch1@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/10/37/8ee885ea35726702ac98145cd3bb8000c88b507ba6a32399e7b08e338b83/questo-0.2.3.tar.gz",
"platform": null,
"description": "# Questo\n\n**Questo** is not your ordinary library of CLI elements; It's a framework. It's modular, extensible, Pythonic and brain friendly. You can build your own CLI elements, with custom key-press handling, validation and rendering, all in plain old Python; No magic.\n\n## Basic Usage\n\n```python\nfrom questo import select, prompt\nfrom yakh import get_key\n\n\nselector = select.Select()\nselector.state = select.SelectState(\n title=\"Who's your favorite Teletubbie\", \n options=[\"Tinky Winky\", \"Dipsy\", \"Laa-Laa\", \"Po\", \"The Weird Vacuum Thing\"], \n selected=4\n)\n\nwith selector.displayed():\n while True:\n selector.state = select.key_handler(selector.state, get_key())\n if selector.state.exit or selector.state.abort:\n break\n\nprompter = prompt.Prompt()\nprompter.state = prompt.PromptState(\n title=f\"Why {selector.result}?\", \n)\n\nwith prompter.displayed():\n while True:\n prompter.state = prompt.key_handler(prompter.state, get_key())\n if prompter.state.exit or prompter.state.abort:\n break\n\nprint(f\"Ah, of course: {prompter.result}\")\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library of extensible and modular CLI prompt elements",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://github.com/petereon/questo",
"Repository": "https://github.com/petereon/questo"
},
"split_keywords": [
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e3a2db2f8135a046860574f0ece1ea110c241a89fae47db86bb8736c17d3cb47",
"md5": "5ba715e81a38370e4a5c8889e52682f8",
"sha256": "861d44b1c04d9a24190dda1aba7ec734076560580fe283e5f8db85a92fb3c927"
},
"downloads": -1,
"filename": "questo-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ba715e81a38370e4a5c8889e52682f8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.7.8",
"size": 9999,
"upload_time": "2024-03-21T18:05:42",
"upload_time_iso_8601": "2024-03-21T18:05:42.884046Z",
"url": "https://files.pythonhosted.org/packages/e3/a2/db2f8135a046860574f0ece1ea110c241a89fae47db86bb8736c17d3cb47/questo-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "10378ee885ea35726702ac98145cd3bb8000c88b507ba6a32399e7b08e338b83",
"md5": "e8a78d94f422b51508c0e7b21b1f8466",
"sha256": "7eb4861f814ad775e45d1fdae020a06093d4322b427cddac655fa274d82d3114"
},
"downloads": -1,
"filename": "questo-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "e8a78d94f422b51508c0e7b21b1f8466",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.7.8",
"size": 7975,
"upload_time": "2024-03-21T18:05:47",
"upload_time_iso_8601": "2024-03-21T18:05:47.151663Z",
"url": "https://files.pythonhosted.org/packages/10/37/8ee885ea35726702ac98145cd3bb8000c88b507ba6a32399e7b08e338b83/questo-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-21 18:05:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "petereon",
"github_project": "questo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "questo"
}