askin
Asynchronous Keyboard Input
askin is a Python package that provides a simple way to get keyboard input asynchronously.
Installation
pip install askin
Usage
from askin import KeyboardController
class KeyState:
def __init__(self) -> None:
self.value = 0
async def update(self, key: str) -> None:
if key == "a":
self.value += 1
elif key == "b":
self.value -= 1
async def key_handler(key: str) -> None:
key_state.update(key)
async def default() -> None:
print("Default! Resetting value to 0")
key_state.value = 0
async def main() -> None:
key_state = KeyState()
controller = KeyboardController(key_handler=key_state.update, default=default, timeout=0.001)
await controller.start()
try:
while True:
print(key_state.value)
await asyncio.sleep(0.1)
finally:
await controller.stop()
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for askin 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| askin-0.0.2.tar.gz | 5.3 kB | With provenance | Details |
Release files / askin-0.0.2.tar.gz
| Download URL | askin-0.0.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13de3cc748c65aeae2608679fa4f3f43ad67b0f54d0d5651f7389686891c3767
|
|
BLAKE2b-256 checksum How to use checksums |
c22cfda3a5c697a006f9bbb08fb4d9add070f56bdd372b0ee92bbba40901aaa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2025.
Transparency logSecurity for askin 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 1 file in this release has been uploaded with provenance metadata.
Attestation for askin-0.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.