inquirer-textual 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/.github/workflows/code-analysis.yml +1 -1
- inquirer_textual-0.2.0/.github/workflows/documentation.yml +19 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/.github/workflows/main.yml +11 -6
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/.github/workflows/release.yml +9 -9
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/.gitignore +1 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/PKG-INFO +16 -3
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/README.md +13 -0
- inquirer_textual-0.2.0/docs/examples/apps/app.gif +0 -0
- inquirer_textual-0.2.0/docs/examples/apps/app.md +11 -0
- inquirer_textual-0.2.0/docs/examples/apps/app.tape +18 -0
- inquirer_textual-0.2.0/docs/examples/prompts/checkbox.gif +0 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/checkbox.md +1 -1
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/checkbox.tape +3 -3
- inquirer_textual-0.2.0/docs/examples/prompts/confirm.gif +0 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/confirm.md +1 -1
- inquirer_textual-0.2.0/docs/examples/prompts/confirm.tape +8 -0
- inquirer_textual-0.2.0/docs/examples/prompts/multi.gif +0 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/multi.md +1 -1
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/multi.tape +3 -3
- inquirer_textual-0.2.0/docs/examples/prompts/number.gif +0 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/number.md +1 -1
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/number.tape +3 -3
- inquirer_textual-0.2.0/docs/examples/prompts/secret.gif +0 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/secret.md +1 -1
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/secret.tape +3 -3
- inquirer_textual-0.2.0/docs/examples/prompts/select.gif +0 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/select.md +1 -1
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/select.tape +3 -3
- inquirer_textual-0.2.0/docs/examples/prompts/text.gif +0 -0
- inquirer_textual-0.2.0/docs/examples/prompts/text.md +11 -0
- {inquirer_textual-0.1.0/docs → inquirer_textual-0.2.0/docs/examples}/prompts/text.tape +2 -2
- inquirer_textual-0.2.0/docs/faq.md +6 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/index.md +21 -4
- inquirer_textual-0.2.0/examples/app.py +21 -0
- inquirer_textual-0.2.0/examples/app_header.py +21 -0
- inquirer_textual-0.2.0/examples/app_shortcuts.py +19 -0
- inquirer_textual-0.2.0/inquirer_textual/InquirerApp.py +156 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/ChoiceCheckboxLabel.py +2 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/ChoiceLabel.py +2 -0
- inquirer_textual-0.2.0/inquirer_textual/common/InquirerHeader.py +31 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/Result.py +4 -2
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/Shortcut.py +3 -1
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/prompts.py +34 -19
- inquirer_textual-0.2.0/inquirer_textual/version.py +1 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerCheckbox.py +2 -1
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerNumber.py +3 -1
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerSecret.py +2 -1
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerSelect.py +11 -6
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerText.py +5 -2
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerWidget.py +3 -1
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/mkdocs.yml +12 -8
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/pyproject.toml +22 -7
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/test_InquirerApp.py +12 -9
- inquirer_textual-0.2.0/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_fullscreen.svg +153 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/test_InquirerCheckbox.py +5 -7
- inquirer_textual-0.2.0/tests/widgets/test_InquirerConfirm.py +68 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/test_InquirerMulti.py +12 -12
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/test_InquirerNumber.py +2 -3
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/test_InquirerSecret.py +7 -9
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/test_InquirerSelect.py +33 -20
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/test_InquirerText.py +12 -9
- inquirer_textual-0.2.0/uv.lock +2377 -0
- inquirer_textual-0.1.0/.python-version +0 -1
- inquirer_textual-0.1.0/docs/prompts/checkbox.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/confirm.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/confirm.tape +0 -8
- inquirer_textual-0.1.0/docs/prompts/multi.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/number.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/secret.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/select.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/text.gif +0 -0
- inquirer_textual-0.1.0/docs/prompts/text.md +0 -5
- inquirer_textual-0.1.0/inquirer_textual/InquirerApp.py +0 -61
- inquirer_textual-0.1.0/inquirer_textual/version.py +0 -1
- inquirer_textual-0.1.0/tests/widgets/test_InquirerConfirm.py +0 -71
- inquirer_textual-0.1.0/uv.lock +0 -1424
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/.capm.yml +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/.github/dependabot.yml +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/CHANGELOG.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/LICENSE +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/assets/favicon.ico +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/assets/logo-light.png +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/checkbox.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/confirm.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/multi.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/number.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/secret.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/select.md +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/docs/reference/text.md +0 -0
- /inquirer_textual-0.1.0/examples/prompts/checkbox.py → /inquirer_textual-0.2.0/examples/prompt_checkbox.py +0 -0
- /inquirer_textual-0.1.0/examples/prompts/confirm.py → /inquirer_textual-0.2.0/examples/prompt_confirm.py +0 -0
- /inquirer_textual-0.1.0/examples/prompts/multi.py → /inquirer_textual-0.2.0/examples/prompt_multi.py +0 -0
- /inquirer_textual-0.1.0/examples/prompts/number.py → /inquirer_textual-0.2.0/examples/prompt_number.py +0 -0
- /inquirer_textual-0.1.0/examples/prompts/secret.py → /inquirer_textual-0.2.0/examples/prompt_secret.py +0 -0
- /inquirer_textual-0.1.0/examples/prompts/select.py → /inquirer_textual-0.2.0/examples/prompt_select.py +0 -0
- /inquirer_textual-0.1.0/examples/prompts/text.py → /inquirer_textual-0.2.0/examples/prompt_text.py +0 -0
- /inquirer_textual-0.1.0/examples/text-with-shortcuts.py → /inquirer_textual-0.2.0/examples/shortcuts.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/examples/validator.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/__init__.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/Choice.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/PromptMessage.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/common/__init__.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerConfirm.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/InquirerMulti.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/inquirer_textual/widgets/__init__.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/__init__.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/__snapshots__/test_InquirerApp/test_snapshot_shortcut.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/__snapshots__/test_InquirerApp/test_snapshot_shortcut_no_description.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__init__.py +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerCheckbox/test_snapshot.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerConfirm/test_snapshot.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerConfirm/test_snapshot_custom_chars.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerConfirm/test_snapshot_default_yes.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fifth_input.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fifth_input_pick_default.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_fourth_input.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_second_input.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerMulti/test_snapshot_third_input.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerNumber/test_snapshot.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerSecret/test_snapshot.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerSecret/test_snapshot_hide_input.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_mandatory.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerSelect/test_snapshot_not_mandatory.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerText/test_snapshot.svg +0 -0
- {inquirer_textual-0.1.0 → inquirer_textual-0.2.0}/tests/widgets/__snapshots__/test_InquirerText/test_snapshot_with_default_value.svg +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy_documentation:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout sources
|
|
13
|
+
uses: actions/checkout@v6
|
|
14
|
+
|
|
15
|
+
- name: Set up uv
|
|
16
|
+
uses: astral-sh/setup-uv@v7
|
|
17
|
+
|
|
18
|
+
- name: Deploy documentation
|
|
19
|
+
run: uv run mkdocs gh-deploy --force
|
|
@@ -4,22 +4,27 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
7
10
|
|
|
8
11
|
jobs:
|
|
9
|
-
|
|
12
|
+
ci:
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.9", "3.14"]
|
|
10
16
|
runs-on: ubuntu-latest
|
|
11
17
|
steps:
|
|
12
18
|
- name: Checkout sources
|
|
13
|
-
uses: actions/checkout@
|
|
19
|
+
uses: actions/checkout@v6
|
|
14
20
|
|
|
15
21
|
- name: Set up uv
|
|
16
|
-
uses: astral-sh/setup-uv@
|
|
22
|
+
uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
17
25
|
|
|
18
26
|
- name: Install dependencies
|
|
19
27
|
run: uv sync --locked --dev
|
|
20
28
|
|
|
21
29
|
- name: Run unit-tests
|
|
22
30
|
run: uv run pytest
|
|
23
|
-
|
|
24
|
-
- name: Deploy documentation
|
|
25
|
-
run: uv run mkdocs gh-deploy --force
|
|
@@ -12,19 +12,19 @@ jobs:
|
|
|
12
12
|
version: ${{ steps.release.outputs.version }}
|
|
13
13
|
steps:
|
|
14
14
|
- name: Checkout sources
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v6
|
|
16
16
|
with:
|
|
17
17
|
fetch-depth: 0
|
|
18
18
|
|
|
19
19
|
- name: Install uv
|
|
20
|
-
uses: astral-sh/setup-uv@
|
|
20
|
+
uses: astral-sh/setup-uv@v7
|
|
21
21
|
|
|
22
22
|
- name: Install dependencies
|
|
23
23
|
run: uv sync --locked --dev
|
|
24
24
|
|
|
25
25
|
- name: Python Semantic Release
|
|
26
26
|
id: release
|
|
27
|
-
uses: relekang/python-semantic-release@
|
|
27
|
+
uses: relekang/python-semantic-release@v10.5.2
|
|
28
28
|
with:
|
|
29
29
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
30
30
|
strict: true
|
|
@@ -37,19 +37,19 @@ jobs:
|
|
|
37
37
|
contents: write
|
|
38
38
|
steps:
|
|
39
39
|
- name: Checkout sources
|
|
40
|
-
uses: actions/checkout@
|
|
40
|
+
uses: actions/checkout@v6
|
|
41
41
|
with:
|
|
42
42
|
ref: main
|
|
43
43
|
fetch-depth: 0
|
|
44
44
|
|
|
45
45
|
- name: Install uv
|
|
46
|
-
uses: astral-sh/setup-uv@
|
|
46
|
+
uses: astral-sh/setup-uv@v7
|
|
47
47
|
|
|
48
48
|
- name: Update lock file
|
|
49
49
|
run: uv lock
|
|
50
50
|
|
|
51
51
|
- name: Push changes
|
|
52
|
-
uses: stefanzweifel/git-auto-commit-action@
|
|
52
|
+
uses: stefanzweifel/git-auto-commit-action@v7
|
|
53
53
|
|
|
54
54
|
release_pypi:
|
|
55
55
|
runs-on: ubuntu-latest
|
|
@@ -62,18 +62,18 @@ jobs:
|
|
|
62
62
|
contents: write
|
|
63
63
|
steps:
|
|
64
64
|
- name: Checkout sources
|
|
65
|
-
uses: actions/checkout@
|
|
65
|
+
uses: actions/checkout@v6
|
|
66
66
|
with:
|
|
67
67
|
ref: main
|
|
68
68
|
|
|
69
69
|
- name: Install uv
|
|
70
|
-
uses: astral-sh/setup-uv@
|
|
70
|
+
uses: astral-sh/setup-uv@v7
|
|
71
71
|
|
|
72
72
|
- name: Install dependencies
|
|
73
73
|
run: uv sync --locked --dev
|
|
74
74
|
|
|
75
75
|
- name: Commit changes
|
|
76
|
-
uses: stefanzweifel/git-auto-commit-action@
|
|
76
|
+
uses: stefanzweifel/git-auto-commit-action@v7
|
|
77
77
|
with:
|
|
78
78
|
commit_message: Build by GitHub Actions
|
|
79
79
|
file_pattern: uv.lock
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: inquirer-textual
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Inquirer based on Textual
|
|
5
5
|
Project-URL: Changelog, https://github.com/robvanderleek/inquirer-textual/blob/master/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://robvanderleek.github.io/inquirer-textual/
|
|
@@ -8,8 +8,8 @@ Project-URL: Source, https://github.com/robvanderleek/inquirer-textual
|
|
|
8
8
|
Author-email: Rob van der Leek <robvanderleek@gmail.com>
|
|
9
9
|
License-Expression: GPL-3.0-or-later
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Python:
|
|
12
|
-
Requires-Dist: textual>=6.
|
|
11
|
+
Requires-Python: <3.15,>=3.9
|
|
12
|
+
Requires-Dist: textual>=6.7.1
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
|
|
15
15
|
# Inquirer-Textual
|
|
@@ -20,6 +20,12 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
|
+
<div align="center">
|
|
24
|
+
|
|
25
|
+
*Versatile library for user input in Python 🎙️*
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
23
29
|
<div align="center">
|
|
24
30
|
|
|
25
31
|
[](https://github.com/robvanderleek/inquirer-textual/actions/workflows/main.yml)
|
|
@@ -28,6 +34,13 @@ Description-Content-Type: text/markdown
|
|
|
28
34
|
|
|
29
35
|
</div>
|
|
30
36
|
|
|
37
|
+
All terminal programs start small. Some stay small, and some become incredibly
|
|
38
|
+
big. The goal of this Python library is to make user input simple for small
|
|
39
|
+
programs, but also support a smooth transition to a comprehensive UI library as
|
|
40
|
+
your program grows.
|
|
41
|
+
|
|
42
|
+
Read the [documentation here](https://robvanderleek.github.io/inquirer-textual/)
|
|
43
|
+
|
|
31
44
|
## Development
|
|
32
45
|
|
|
33
46
|
Add this library as an editable local dependency to another project using `uv`:
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
*Versatile library for user input in Python 🎙️*
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
9
15
|
<div align="center">
|
|
10
16
|
|
|
11
17
|
[](https://github.com/robvanderleek/inquirer-textual/actions/workflows/main.yml)
|
|
@@ -14,6 +20,13 @@
|
|
|
14
20
|
|
|
15
21
|
</div>
|
|
16
22
|
|
|
23
|
+
All terminal programs start small. Some stay small, and some become incredibly
|
|
24
|
+
big. The goal of this Python library is to make user input simple for small
|
|
25
|
+
programs, but also support a smooth transition to a comprehensive UI library as
|
|
26
|
+
your program grows.
|
|
27
|
+
|
|
28
|
+
Read the [documentation here](https://robvanderleek.github.io/inquirer-textual/)
|
|
29
|
+
|
|
17
30
|
## Development
|
|
18
31
|
|
|
19
32
|
Add this library as an editable local dependency to another project using `uv`:
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Output docs/examples/apps/app.gif
|
|
2
|
+
Set Shell zsh
|
|
3
|
+
Set Theme { "background": "#000000" }
|
|
4
|
+
Type "uv run examples/app.py"
|
|
5
|
+
Enter
|
|
6
|
+
Sleep 2s
|
|
7
|
+
Type Rob
|
|
8
|
+
Sleep 1s
|
|
9
|
+
Enter
|
|
10
|
+
Sleep 1s
|
|
11
|
+
Down 2
|
|
12
|
+
Sleep 1s
|
|
13
|
+
Enter
|
|
14
|
+
Sleep 1s
|
|
15
|
+
Down 3
|
|
16
|
+
Sleep 1s
|
|
17
|
+
Enter
|
|
18
|
+
Sleep 2s
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Output checkbox.gif
|
|
1
|
+
Output docs/examples/prompts/checkbox.gif
|
|
2
2
|
Set Shell zsh
|
|
3
3
|
Set Theme { "background": "#000000" }
|
|
4
|
-
Type "uv run examples/
|
|
4
|
+
Type "uv run examples/prompt_checkbox.py"
|
|
5
5
|
Enter
|
|
6
|
-
Sleep
|
|
6
|
+
Sleep 2s
|
|
7
7
|
Down
|
|
8
8
|
Sleep 0.5s
|
|
9
9
|
Down
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Output number.gif
|
|
1
|
+
Output docs/examples/prompts/number.gif
|
|
2
2
|
Set Shell zsh
|
|
3
3
|
Set Theme { "background": "#000000" }
|
|
4
|
-
Type "uv run examples/
|
|
4
|
+
Type "uv run examples/prompt_number.py"
|
|
5
5
|
Enter
|
|
6
|
-
Sleep
|
|
6
|
+
Sleep 2s
|
|
7
7
|
Type "1024"
|
|
8
8
|
Sleep 1s
|
|
9
9
|
Enter
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Output secret.gif
|
|
1
|
+
Output docs/examples/prompts/secret.gif
|
|
2
2
|
Set Shell zsh
|
|
3
3
|
Set Theme { "background": "#000000" }
|
|
4
|
-
Type "uv run examples/
|
|
4
|
+
Type "uv run examples/prompt_secret.py"
|
|
5
5
|
Enter
|
|
6
|
-
Sleep
|
|
6
|
+
Sleep 2s
|
|
7
7
|
Type helloworld
|
|
8
8
|
Sleep 1s
|
|
9
9
|
Enter
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Output select.gif
|
|
1
|
+
Output docs/examples/prompts/select.gif
|
|
2
2
|
Set Shell zsh
|
|
3
3
|
Set Theme { "background": "#000000" }
|
|
4
|
-
Type "uv run examples/
|
|
4
|
+
Type "uv run examples/prompt_select.py"
|
|
5
5
|
Enter
|
|
6
|
-
Sleep
|
|
6
|
+
Sleep 2s
|
|
7
7
|
Down
|
|
8
8
|
Sleep 0.5s
|
|
9
9
|
Down
|
|
Binary file
|
|
@@ -23,13 +23,30 @@
|
|
|
23
23
|
|
|
24
24
|
## About
|
|
25
25
|
|
|
26
|
-
All programs start small. Some stay small, and some become incredibly
|
|
27
|
-
goal of this Python library is to make user input simple for small
|
|
28
|
-
|
|
26
|
+
All terminal programs start small. Some stay small, and some become incredibly
|
|
27
|
+
big. The goal of this Python library is to make user input simple for small
|
|
28
|
+
programs, but also support a smooth transition to a comprehensive UI library as
|
|
29
|
+
your program grows.
|
|
29
30
|
|
|
30
|
-
This library is based on the sophisticated
|
|
31
|
+
This library is based on the sophisticated
|
|
31
32
|
[Textual](https://textual.textualize.io/) TUI framework.
|
|
32
33
|
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
The Python code for the example above:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
--8<-- "examples/prompt_checkbox.py"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
With `uv` you can run the example out of the box:
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
uv run --with inquirer-textual checkbox.py
|
|
48
|
+
```
|
|
49
|
+
|
|
33
50
|
## Key features and design principles
|
|
34
51
|
|
|
35
52
|
* **Keep simple things simple**: High-level prompts API for getting user input
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from inquirer_textual.InquirerApp import InquirerApp
|
|
2
|
+
from inquirer_textual.widgets.InquirerSelect import InquirerSelect
|
|
3
|
+
from inquirer_textual.widgets.InquirerText import InquirerText
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def wizard(app: InquirerApp):
|
|
7
|
+
name = app.prompt(InquirerText('What is your name?'))
|
|
8
|
+
language = app.prompt(InquirerSelect(f'Hi {name}, what is your favorite programming language?',
|
|
9
|
+
['go', 'javascript', 'python', 'rust']))
|
|
10
|
+
why = app.prompt(InquirerSelect(f'And what do you like so much about {language}?',
|
|
11
|
+
['Community', 'Libraries', 'Performance', 'Syntax']))
|
|
12
|
+
app.stop({'name': name.value, 'language': language.value, 'why': why.value})
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def main():
|
|
16
|
+
result = InquirerApp().run(inline=True, inquiry_func=wizard)
|
|
17
|
+
print(result)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if __name__ == '__main__':
|
|
21
|
+
main()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from inquirer_textual.InquirerApp import InquirerApp
|
|
2
|
+
from inquirer_textual.common.Shortcut import Shortcut
|
|
3
|
+
from inquirer_textual.widgets.InquirerSelect import InquirerSelect
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def wizard(app: InquirerApp):
|
|
7
|
+
language = app.prompt(InquirerSelect('What is your favorite programming language?',
|
|
8
|
+
['go', 'javascript', 'python', 'rust']),
|
|
9
|
+
shortcuts=[Shortcut('c', 'select', 'Choose')])
|
|
10
|
+
app.stop({'language': language.value})
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main():
|
|
14
|
+
app = InquirerApp()
|
|
15
|
+
app.header = "[bold]Programming Language Survey[/bold]"
|
|
16
|
+
result = app.run(inquiry_func=wizard)
|
|
17
|
+
print(result)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if __name__ == '__main__':
|
|
21
|
+
main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from inquirer_textual.InquirerApp import InquirerApp
|
|
2
|
+
from inquirer_textual.common.Shortcut import Shortcut
|
|
3
|
+
from inquirer_textual.widgets.InquirerSelect import InquirerSelect
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def wizard(app: InquirerApp):
|
|
7
|
+
language = app.prompt(InquirerSelect('What is your favorite programming language?',
|
|
8
|
+
['go', 'javascript', 'python', 'rust']),
|
|
9
|
+
shortcuts=[Shortcut('c', 'select', 'Choose')])
|
|
10
|
+
app.stop({'language': language.value})
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main():
|
|
14
|
+
result = InquirerApp().run(inline=True, inquiry_func=wizard)
|
|
15
|
+
print(result)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == '__main__':
|
|
19
|
+
main()
|