Skip to main content

Interactive keyboard input utilities (wait_key, count)

Project description

scitex-etc

SciTeX

Interactive keyboard input utilities for the SciTeX ecosystem.

Full Documentation · uv pip install scitex-etc[all]

pypi python docs

tests install-check cov


Problem and Solution

# Problem Solution
1 Scripts that pause for a keypress need raw-stdin + termios gymnastics — 15 lines of OS-dependent boilerplate wait_key() / count() — one import; handles Linux/macOS/Windows; falls back cleanly when stdin isn't a TTY

Installation

pip install scitex-etc

Architecture

scitex-etc/
├── src/scitex_etc/
│   ├── _wait_key.py     # cross-platform raw-stdin keypress
│   └── _count.py        # countdown helper
└── tests/

1 Interfaces

Python API
from scitex_etc import wait_key, count

# Block until a single key is pressed; returns the key as a string.
key = wait_key()

# Countdown helper — prints "5… 4… 3…" and waits a second between each.
count(5)

Demo

flowchart LR
    User[User keypress] --> TTY{stdin is TTY?}
    TTY -- yes --> Termios[termios raw mode]
    TTY -- no --> Fallback[readline fallback]
    Termios --> Key[key string]
    Fallback --> Key

Quick Start

from scitex_etc import wait_key, count

key = wait_key()  # Wait for a single keypress
count(5)          # Countdown timer

Part of SciTeX

scitex-etc is part of SciTeX. Install via the umbrella with pip install scitex[etc] to use as scitex.etc (Python) or scitex etc ... (CLI).

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0


SciTeX

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

scitex_etc-0.1.9.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

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

scitex_etc-0.1.9-py3-none-any.whl (8.4 MB view details)

Uploaded Python 3

File details

Details for the file scitex_etc-0.1.9.tar.gz.

File metadata

  • Download URL: scitex_etc-0.1.9.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_etc-0.1.9.tar.gz
Algorithm Hash digest
SHA256 501001391abb0e9e939a18cb7d0a4396814258995809f8b5e308adf696c59c73
MD5 48ba976ceae5a5a7c17665301264f77e
BLAKE2b-256 1a1467e846e5e876231963bfed4f32deaafb8eb4e80aca1d626ea35ec487d2e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_etc-0.1.9.tar.gz:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-etc

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

File details

Details for the file scitex_etc-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: scitex_etc-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 8.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_etc-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 10569fb762913fcee208c73d70a8cda6c5b74567c07796cf0d37f3ad382ae24b
MD5 ddd2ef603e058b26f7c80f539ac6a539
BLAKE2b-256 82efd238cca9c2966bd05601452a22cfce65b7d8630793f6c372bce6f4aece38

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_etc-0.1.9-py3-none-any.whl:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-etc

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