Skip to main content

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:

  1. Console (CLI)
  2. GUI (Tkinter)
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dworshak_prompt-0.1.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dworshak_prompt-0.1.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file dworshak_prompt-0.1.3.tar.gz.

File metadata

  • Download URL: dworshak_prompt-0.1.3.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

Hashes for dworshak_prompt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f8befb60822811b8f7688b48e7521253c9c74c301beaf23fa56c40f8933af882
MD5 056462caa0dfa49e51604897e123882c
BLAKE2b-256 67971e67c97cb3e57514bcba215dde5e32c5df86c9d0483f5e6d4fafe5d369b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for dworshak_prompt-0.1.3.tar.gz:

Publisher: publish.yml on City-of-Memphis-Wastewater/dworshak-prompt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dworshak_prompt-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for dworshak_prompt-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c2a5ade3908b3326b002001a221a2b978bb159b44b61dd0700ef5b50eebf28b
MD5 6f67e6bb5d5e732e430e062ff0844a98
BLAKE2b-256 a2dcf459a121a098bd7482bcf1199fbd003ab12455ed7fcd232ce17ba875333b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dworshak_prompt-0.1.3-py3-none-any.whl:

Publisher: publish.yml on City-of-Memphis-Wastewater/dworshak-prompt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page