pylayout
pylayout is a Python module for getting and setting the current keyboard layout in Windows. It also includes utilities for detecting the language of input characters and translating text between keyboard layouts.
It supports Windows and linux systems.
Installation
pip install pylayout
Usage
from pylayout import Layout
layout = Layout(use_cache=False) # use_cache=True reduces calls to the system to acquire list of available layouts speeding up module
print("Current layout:", layout.get())
print("Available layouts:", layout.list())
layout.set("uk") # Set layout to Ukrainian
print("New layout:", layout.get())
# Currently translate and detect_language support only us and uk languages. Can be extended by modifying LAYOUTS dict
char = "ї"
print(f"Language for '{char}':", layout.detect_language(char))
print("Translate 'ghbdsn' from 'en' to 'uk':", layout.translate("ghbdsn", "en", "uk"))
Features
- Get the current keyboard layout
- Set the keyboard layout by language code (e.g.,
en,uk) - List all available keyboard layouts
- Detect the language associated with a given character
- Translate text from one keyboard layout to another (e.g., fix "ghbdsn" typed in the wrong layout)
Fixes
There are some issues on windows so here are some resources to fix them
Release files for pylayout 0.1.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 | |
|---|---|---|---|
| pylayout-0.1.2.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylayout-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / pylayout-0.1.2.tar.gz
| Download URL | pylayout-0.1.2.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f26be7183ecc327509b09379489ab7bf3bf30d29bde0c9f982b1398555432c0e
|
|
BLAKE2b-256 checksum How to use checksums |
d1cb206406769ff55857412bf98cb0091172e29d96679d911a06cc7d7f65d966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / pylayout-0.1.2-py3-none-any.whl
| Download URL | pylayout-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d2a1d26dc4077460fb79eea0547328642ae26bb736942f72a5fce842f06dd25
|
|
BLAKE2b-256 checksum How to use checksums |
e2b8599bc60bc0983f29e25685f8289f5bfc5a63dcbaec2810b9e7d34a597cc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|