Name | questo JSON |
Version |
0.4.1
JSON |
| download |
home_page | None |
Summary | A library of extensible and modular CLI prompt elements |
upload_time | 2025-01-14 18:13:45 |
maintainer | None |
docs_url | None |
author | Peter Vyboch |
requires_python | <4.0.0,>=3.7.8 |
license | MIT |
keywords |
python
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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": null,
"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/1b/2a/ace6f441af4bf71a926183255ecf82dc2574c0203408ff466354f3c2256c/questo-0.4.1.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.4.1",
"project_urls": {
"Repository": "https://github.com/petereon/questo"
},
"split_keywords": [
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "53d571ad81de9c569b1b2e2baa5a60e85102c35fe898007de7ea2136c291b4ce",
"md5": "38c7b445f86d36b43dcb5de02399bb51",
"sha256": "57515abdec03e9b2ddcdfe7031e8b1742408fe61c9914b1395c0caa4f9abad7b"
},
"downloads": -1,
"filename": "questo-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "38c7b445f86d36b43dcb5de02399bb51",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.7.8",
"size": 10108,
"upload_time": "2025-01-14T18:13:43",
"upload_time_iso_8601": "2025-01-14T18:13:43.926838Z",
"url": "https://files.pythonhosted.org/packages/53/d5/71ad81de9c569b1b2e2baa5a60e85102c35fe898007de7ea2136c291b4ce/questo-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1b2aace6f441af4bf71a926183255ecf82dc2574c0203408ff466354f3c2256c",
"md5": "7f8f3419decfe2620bece1ec3db8839d",
"sha256": "efe4fb0ca68606555a5357d6424d4116081e9af7f10d8a6208039aa9b130d30f"
},
"downloads": -1,
"filename": "questo-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "7f8f3419decfe2620bece1ec3db8839d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.7.8",
"size": 7418,
"upload_time": "2025-01-14T18:13:45",
"upload_time_iso_8601": "2025-01-14T18:13:45.002960Z",
"url": "https://files.pythonhosted.org/packages/1b/2a/ace6f441af4bf71a926183255ecf82dc2574c0203408ff466354f3c2256c/questo-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 18:13:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "petereon",
"github_project": "questo",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "questo"
}