-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
58 lines (53 loc) · 1.25 KB
/
__init__.py
File metadata and controls
58 lines (53 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""Python-Clack: Beautiful CLI prompts for Python.
A Python port of the Node.js clack package for creating beautiful,
interactive command-line interfaces.
Example:
>>> from python_clack import intro, text, select, confirm, outro, is_cancel
>>>
>>> intro("Welcome to my app")
>>>
>>> name = text("What is your name?", placeholder="Anonymous")
>>> if is_cancel(name):
... outro("Cancelled!")
... exit(1)
>>>
>>> color = select(
... "Pick a color",
... options=[
... {"value": "red", "label": "Red"},
... {"value": "blue", "label": "Blue"},
... ]
... )
>>>
>>> outro("All done!")
"""
from ._core.state import CANCEL, is_cancel
from .group import group
from .log import Log, log
from .messages import cancel, intro, outro
from .prompts import confirm, multiselect, password, select, text
from .spinner import Spinner, spinner
__version__ = "0.1.0"
__all__ = [
# Version
"__version__",
# Core utilities
"CANCEL",
"is_cancel",
# Prompts
"text",
"select",
"multiselect",
"confirm",
"password",
# Messages
"intro",
"outro",
"cancel",
# Utilities
"log",
"Log",
"spinner",
"Spinner",
"group",
]