--- id: python-yakh version: "0.4.1" license: MIT license_treatment: permissive maintenance: dormant --- # python-yakh — Yet Another Keypress Handler License: permissive · Maintenance: dormant · Downloads: 90.0K/mo ## What it is and what it does yakh is a minimal terminal keypress handler that reads individual key events from stdin and returns them as Key objects. It abstracts away platform differences so you can detect keypresses—including special keys like CTRL combinations—without managing raw terminal modes yourself. The library has no runtime dependencies and exposes a single blocking function, `get_key()`, that returns a Key instance with the pressed key's character representation, Unicode code points, and a printability flag. Typical use is in terminal user interfaces or interactive CLI tools where you need to respond to individual keypresses rather than waiting for a full line of input. The Key class is comparable to strings and Unicode tuples, making it easy to check for specific keys or key combinations. Platform-specific key constants are available through the `Keys` class for common keys like ENTER and CTRL variants. Use it for: - Build interactive terminal menus or games that respond to single keypresses without waiting for Enter. - Implement keyboard shortcuts in CLI tools (e.g., 'q' to quit, arrow keys to navigate). - Create terminal-based input handlers that need to detect special keys like CTRL+C or function keys. - Develop cross-platform terminal applications that handle keypresses consistently on Windows, macOS, and Linux. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Captures individual keypresses from terminal stdin in a platform-independent way, returning key objects with character data, Unicode code points, and printability information. Yes, if you need simple cross-platform keypress handling in a terminal. The zero-dependency design and low install friction make it lightweight. However, maintenance is dormant—last commit was 2025-01-14 with no recent releases—so expect no active bug fixes or feature development. Suitable for small projects or scripts; for production systems requiring ongoing support, evaluate alternatives or plan to maintain a fork. ## Install pip install python-yakh uv add python-yakh poetry add python-yakh ## Installing python-yakh Before you install: Low install friction with no runtime dependencies. Maintenance is dormant—last commit was 2025-01-14 but no release since then; the package works on modern Python versions (3.8–3.13) but receives infrequent updates. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install python-yakh from yakh import get_key from yakh.key import Keys key = get_key() # blocks until a key is pressed if key.is_printable: print(key) Requires a terminal environment with stdin access; behavior is platform-dependent for special keys like CTRL combinations. Verify before relying: - Whether the package handles all terminal emulators consistently (Windows, macOS, Linux). - Performance characteristics when called in tight loops or high-frequency polling scenarios. - Compatibility with non-ASCII input or IME (input method editor) systems. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 90.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags terminal keypress capture, stdin keyboard input handler, cross-platform key detection, terminal key events, read single keypress, keyboard input library, terminal-ui, keyboard-input [View on SkillFed](https://skillfed.io/packages/python-yakh) · [View on PyPI](https://pypi.org/project/python-yakh/)