Registry / python-yakh

python-yakh

JSON →
library0.4.1pypypi✓ verified 30d ago

A cross-platform library for handling keypress events in the terminal. Supports both Unix and Windows systems. Current version: 0.4.1. Release cadence: irregular.

Install & Compatibility
Where this runs
tested against v0.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from yakh import get_key
from yakh import key

Simple example: listen for keypresses for 5 seconds and print each key.

from yakh import KeypressHandler def on_key(key): print(f"Pressed: {key}") handler = KeypressHandler() handler.key_pressed += on_key handler.start() import time time.sleep(5) handler.stop()
Debug
Known footguns
gotchaThe KeypressHandler runs in a separate thread. Ensure you stop the handler properly to avoid hanging processes. Always call handler.stop() before exiting.
gotchaOn Unix, the handler sets the terminal to raw mode. If the program crashes or exits without calling stop(), the terminal may be left in a broken state. Use atexit or signal handlers to restore terminal settings.
deprecatedIn version 0.2.1 and earlier, the handler had a bug where the fd was not reset to blocking state. Make sure to use 0.2.1 or later.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
4
ahrefsbot
3
claudebot
2
script
1
Resources