Name | aprompt JSON |
Version |
3.0.1
JSON |
| download |
home_page | |
Summary | Advanced Prompts |
upload_time | 2023-04-22 13:16:14 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.10 |
license | MIT |
keywords |
form
input
prompt
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
aprompt - Advanced Prompt
=========================
Why use `input()` when you can go _advanced_?
*aprompt* lets you prompt users in a neat way. It comes with a UI system
and everything is customizable!
![Demonstration](https://raw.githubusercontent.com/phoenixr-codes/aprompt/main/docs/media/prompt-choice.gif)
[![Documentation Status](https://readthedocs.org/projects/aprompt/badge/?version=latest)](https://aprompt.readthedocs.io/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Features
--------
* ✅ Large set of built-in prompts.
* ✅ Custom prompts
* ✅ Custom themes
* ✅ Drop-in replacement for
[argparse](https://docs.python.org/3/library/argparse.html?highlight=argparse#module-argparse)
* ✅ Test API
Available Prompts
-----------------
While it is easily possible to create custom prompts, aprompt comes with
a lot of useful prompts.
* [x] Text
* [x] Integer
* [x] Confirmation
* [x] PIN Code
* [x] Sort
* [x] Choice
* [x] Multiple Choice
* [ ] Path
* [ ] Datetime
* [ ] Date
* [ ] Time
_Unchecked prompts are planned for the future_
Basic Usage
-----------
```python
from aprompt import prompt
from aprompt.prompts import choice
languages: list[str] = prompt(
"In what languages can you code in?",
choice(
"c",
"c++",
"erlang",
"fortran",
"haskell",
"javascript",
"nim",
"python",
"ruby",
"rust",
"typescript",
multiple=True
)
)
# ... do something with `languages` ...
```
Test API
--------
*aprompt* provides the attribute `test_with` for the main prompt wrapper to
test the result for a predefined sequence of keys.
```python
def test_n() -> None:
assert not prompt("", confirm(), test_with=iter("n\n"))
```
Links
-----
* [🐍 Repo](https://github.com/phoenixr-codes/aprompt)
* [📦 PyPI](https://pypi.org/project/aprompt)
* [📖 Docs](https://aprompt.readthedocs.io/)
ToDo
----
* add path prompt (as extension) and document it
* turn `match`es to `if-else`s
* add demo file and add a GIF of it to the README (instead of only the choice variant)
* add GIFs to all prompt engines docs
* turn simple formatter into a class
* add logo
Raw data
{
"_id": null,
"home_page": "",
"name": "aprompt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "form,input,prompt",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/cd/98/ebd6ccfca5cbe9f42dfc6f331aa27cbe62b626c29b4f91f4b58072959a68/aprompt-3.0.1.tar.gz",
"platform": null,
"description": "aprompt - Advanced Prompt\n=========================\n\nWhy use `input()` when you can go _advanced_?\n\n*aprompt* lets you prompt users in a neat way. It comes with a UI system\nand everything is customizable!\n\n![Demonstration](https://raw.githubusercontent.com/phoenixr-codes/aprompt/main/docs/media/prompt-choice.gif)\n\n[![Documentation Status](https://readthedocs.org/projects/aprompt/badge/?version=latest)](https://aprompt.readthedocs.io/en/latest/?badge=latest)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nFeatures\n--------\n\n* \u2705 Large set of built-in prompts.\n* \u2705 Custom prompts\n* \u2705 Custom themes\n* \u2705 Drop-in replacement for\n [argparse](https://docs.python.org/3/library/argparse.html?highlight=argparse#module-argparse)\n* \u2705 Test API\n\n\nAvailable Prompts\n-----------------\n\nWhile it is easily possible to create custom prompts, aprompt comes with\na lot of useful prompts.\n\n* [x] Text\n* [x] Integer\n* [x] Confirmation\n* [x] PIN Code\n* [x] Sort\n* [x] Choice\n* [x] Multiple Choice\n* [ ] Path\n* [ ] Datetime\n* [ ] Date\n* [ ] Time\n\n_Unchecked prompts are planned for the future_\n\n\nBasic Usage\n-----------\n\n```python\nfrom aprompt import prompt\nfrom aprompt.prompts import choice\n\nlanguages: list[str] = prompt(\n \"In what languages can you code in?\",\n choice(\n \"c\",\n \"c++\",\n \"erlang\",\n \"fortran\",\n \"haskell\",\n \"javascript\",\n \"nim\",\n \"python\",\n \"ruby\",\n \"rust\",\n \"typescript\",\n multiple=True\n )\n)\n\n# ... do something with `languages` ...\n```\n\nTest API\n--------\n\n*aprompt* provides the attribute `test_with` for the main prompt wrapper to\ntest the result for a predefined sequence of keys.\n\n```python\ndef test_n() -> None:\n assert not prompt(\"\", confirm(), test_with=iter(\"n\\n\"))\n```\n\n\nLinks\n-----\n\n* [\ud83d\udc0d Repo](https://github.com/phoenixr-codes/aprompt)\n* [\ud83d\udce6 PyPI](https://pypi.org/project/aprompt)\n* [\ud83d\udcd6 Docs](https://aprompt.readthedocs.io/)\n\n\nToDo\n----\n\n* add path prompt (as extension) and document it\n* turn `match`es to `if-else`s\n* add demo file and add a GIF of it to the README (instead of only the choice variant)\n* add GIFs to all prompt engines docs\n* turn simple formatter into a class\n* add logo\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Advanced Prompts",
"version": "3.0.1",
"split_keywords": [
"form",
"input",
"prompt"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "da01539194585928d2165bd498d573b8724c227901467f44244cb652d0f983e5",
"md5": "9e1a4eb94adbe016f44b7d5614002d9f",
"sha256": "08551a6be234b42c8587fad4ad49dd6cb02d835e4e3f284f07893645a9e81d9d"
},
"downloads": -1,
"filename": "aprompt-3.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9e1a4eb94adbe016f44b7d5614002d9f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 13480,
"upload_time": "2023-04-22T13:16:11",
"upload_time_iso_8601": "2023-04-22T13:16:11.596208Z",
"url": "https://files.pythonhosted.org/packages/da/01/539194585928d2165bd498d573b8724c227901467f44244cb652d0f983e5/aprompt-3.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cd98ebd6ccfca5cbe9f42dfc6f331aa27cbe62b626c29b4f91f4b58072959a68",
"md5": "fe4ac5904287102874c2fd058facdedb",
"sha256": "b891c25b6ca3c21c7ee3ba84edbfd4a0f35415f6349bfc4622ea2ab43688c281"
},
"downloads": -1,
"filename": "aprompt-3.0.1.tar.gz",
"has_sig": false,
"md5_digest": "fe4ac5904287102874c2fd058facdedb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 76138,
"upload_time": "2023-04-22T13:16:14",
"upload_time_iso_8601": "2023-04-22T13:16:14.268625Z",
"url": "https://files.pythonhosted.org/packages/cd/98/ebd6ccfca5cbe9f42dfc6f331aa27cbe62b626c29b4f91f4b58072959a68/aprompt-3.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-22 13:16:14",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "aprompt"
}