click-prompt-0.5.1
توضیحات
click-prompt provides more beautiful interactive options for the Python click library
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | click-prompt-0.5.1 |
| نام | click-prompt |
| نسخه کتابخانه | 0.5.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Markus Grotz |
| ایمیل نویسنده | grotz@uw.edu |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/click-prompt/ |
| مجوز | MIT |
# click-prompt
[](https://pypi.org/project/click-prompt/)
[](https://pypi.org/project/click-prompt/)
click-prompt provides more beautiful interactive options for the Python click
library. The library is inspired by a post on [stackoverflow.com](https://stackoverflow.com/questions/54311067/)
## Usage
The library can be used in two ways: 1) as decorator, or 2) as type parameter.
### With decorators
```python
import click
from click_prompt import choice_option
@click.command()
@choice_option('--fruit', type=click.Choice(['Apples', 'Bananas', 'Grapefruits', 'Mangoes']))
def select_fruit(fruit: str):
print(fruit)
```
### As class
```python
import click
from click_prompt import ChoiceOption
@click.command()
@click.option('--fruit',
type=click.Choice(['Apples', 'Bananas', 'Grapefruits', 'Mangoes']),
cls=ChoiceOption)
def select_fruit(fruit: str):
print(fruit)
```
## Example

## Available Decorators
Here is a list of available decorators that can be used with the click library
instead of a `click.Option` decorator
- `choice_option`: Select a single item out of a list. Use the parameter
`multiple=True` to select multiple items out of a list
- `confirm_option`: Yes/No confirmation
- `filepath_option`: Select a file path with auto completion
- `auto_complete_option`: Auto completion given a list
for every `click.Option` there is also a `click.Argument` implementation
نیازمندی
| مقدار | نام |
|---|---|
| >=8.0.4 | click |
| >=1.10.0,<2.0.0 | questionary |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.9,<4.0 | Python |
نحوه نصب
نصب پکیج whl click-prompt-0.5.1:
pip install click-prompt-0.5.1.whl
نصب پکیج tar.gz click-prompt-0.5.1:
pip install click-prompt-0.5.1.tar.gz