A Python library for parsing the serialized format used on keyboard-layout-editor.com (KLE).
Project description
pykle-serial
pykle-serial is a Python library for parsing the serialized format used on keyboard-layout-editor.com (KLE).
pykle-serial is a Python port of kle-serial, based on commit #4080386 on Dec 31, 2019 and includes Fix issue with incorrect x and y for rotated key.
Usage
import pykle_serial as kle_serial
keyboard = kle_serial.deserialize([
{'name': "Sample", 'author': "Your Name"},
["Q", "W", "E", "R", "T", "Y"]
])
# or
keyboard = kle_serial.parse('''[
{ name: "Sample", author: "Your Name" },
["Q", "W", "E", "R", "T", "Y"]
]''')
About the details of keyboard, see original kle-serial.
Noticeable differences from original kle-serial
labels/textColor/textSizeofKeyclass always have 12 elements.
JavaScript's array esoterically supports out-of-index access. Python's list doesn't.
- (implicit)
textSizeis int.
JavaScript doesn't distinguish between float and int. Python does.
Caveats
-
KLE's "Raw data" text requires additional outer
[]as JSON5. -
labelsis HTML fragment.
License
MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pykle_serial-0.1.1.tar.gz.
File metadata
- Download URL: pykle_serial-0.1.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b8a1e608cb71e652cfad083e43302e3d8faeedc8cc5cb7dad1024ce0e8e31ca
|
|
| MD5 |
1da09a0a961cc371360b62ba4e9d2917
|
|
| BLAKE2b-256 |
b97523d9dd724cf0f84039918e6f06e7a84129ce4ae0d74848b5b9708edbe560
|
File details
Details for the file pykle_serial-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pykle_serial-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25afe6a382acb275bab2a890d2bb9b6a3135da50a62c83b68b10fe85180d2c8e
|
|
| MD5 |
1edc920c1850accd8a2ed32ef627f1a4
|
|
| BLAKE2b-256 |
51a6bf1dd6afbabcaf5b19329a1899168c0391d82e99f0cba28db2da1614907b
|