aprompt-3.0.1
توضیحات
Advanced Prompts
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aprompt-3.0.1 |
| نام | aprompt |
| نسخه کتابخانه | 3.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/aprompt/ |
| مجوز | MIT |
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!

[](https://aprompt.readthedocs.io/en/latest/?badge=latest)
[](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
نیازمندی
| مقدار | نام |
|---|---|
| - | attrs |
| - | platformdirs |
| - | readchar |
| - | mypy |
| - | pytest |
| >=2022.12.7 | furo |
| >=1.0 | myst-parser |
| >=6.1 | Sphinx |
| >=0.5 | sphinx-copybutton |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl aprompt-3.0.1:
pip install aprompt-3.0.1.whl
نصب پکیج tar.gz aprompt-3.0.1:
pip install aprompt-3.0.1.tar.gz