Multiplexed input from CLI, GUI, and WEB, depending on availability.
Project description
dworshak-prompt
A Python utility that ensures you can always get user input by falling back through multiple interfaces.
How it works
It captures input by cycling through modes based on environment availability:
- Console (CLI)
- GUI (Tkinter)
- Web (Local Browser Server)
Automatically skips incompatible modes (e.g., GUI on WSL) via pyhabitat.
Usage
from dworshak_prompt import DworshakPrompt, PromptMode
# Basic
val = DworshakPrompt.ask("Enter value")
# Options
val = DworshakPrompt.ask(
"Secure Key",
hide_input=True,
priority = [PromptMode.CONSOLE, PromptMode.GUI]
avoid = {PromptMode.WEB}
)
Another example, for handling CI:
from dworshak_prompt import DworshakPrompt, PromptMode
# If this runs in GitHub Actions, it returns "staging" immediately.
# If it runs on a laptop, it pops up a GUI or Console prompt.
val = DworshakPrompt.ask(
"Target Environment",
suggestion="production", # What the human sees
default="staging" # What the CI/Headless system uses
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dworshak_prompt-0.1.4.tar.gz.
File metadata
- Download URL: dworshak_prompt-0.1.4.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a060581f718370153729a9fd26a03c5d5d6a0db70e12f0920181b64a34c0aee
|
|
| MD5 |
29dc5e98d3599fc8e6d92ad8ae8122f6
|
|
| BLAKE2b-256 |
d7df2f6844457ab417e2b328f18b500f9004183064ead3308ee83d627c966918
|
Provenance
The following attestation bundles were made for dworshak_prompt-0.1.4.tar.gz:
Publisher:
publish.yml on City-of-Memphis-Wastewater/dworshak-prompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dworshak_prompt-0.1.4.tar.gz -
Subject digest:
2a060581f718370153729a9fd26a03c5d5d6a0db70e12f0920181b64a34c0aee - Sigstore transparency entry: 925690788
- Sigstore integration time:
-
Permalink:
City-of-Memphis-Wastewater/dworshak-prompt@770a84e5eba1a20f10e9140824d7b5eb00df7d57 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/City-of-Memphis-Wastewater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@770a84e5eba1a20f10e9140824d7b5eb00df7d57 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dworshak_prompt-0.1.4-py3-none-any.whl.
File metadata
- Download URL: dworshak_prompt-0.1.4-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2acfcfb2d7100f864c6645b01766b49559bc191ce79bc7ea73d433c672387245
|
|
| MD5 |
7eb8f376f9e94ba52d798824b89e44c4
|
|
| BLAKE2b-256 |
1343e72a8d06fed9fa9ed278973d8b8fc40fa5f8484cff1385c4940a9cefb47b
|
Provenance
The following attestation bundles were made for dworshak_prompt-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on City-of-Memphis-Wastewater/dworshak-prompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dworshak_prompt-0.1.4-py3-none-any.whl -
Subject digest:
2acfcfb2d7100f864c6645b01766b49559bc191ce79bc7ea73d433c672387245 - Sigstore transparency entry: 925690790
- Sigstore integration time:
-
Permalink:
City-of-Memphis-Wastewater/dworshak-prompt@770a84e5eba1a20f10e9140824d7b5eb00df7d57 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/City-of-Memphis-Wastewater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@770a84e5eba1a20f10e9140824d7b5eb00df7d57 -
Trigger Event:
release
-
Statement type: