Skip to main content

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 / textSize of Key class always have 12 elements.

JavaScript's array esoterically supports out-of-index access. Python's list doesn't.

  • (implicit) textSize is int.

JavaScript doesn't distinguish between float and int. Python does.

Caveats

  • KLE's "Raw data" text requires additional outer [] as JSON5.

  • labels is HTML fragment.

License

MIT license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykle_serial-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykle_serial-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for pykle_serial-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b8a1e608cb71e652cfad083e43302e3d8faeedc8cc5cb7dad1024ce0e8e31ca
MD5 1da09a0a961cc371360b62ba4e9d2917
BLAKE2b-256 b97523d9dd724cf0f84039918e6f06e7a84129ce4ae0d74848b5b9708edbe560

See more details on using hashes here.

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

Hashes for pykle_serial-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25afe6a382acb275bab2a890d2bb9b6a3135da50a62c83b68b10fe85180d2c8e
MD5 1edc920c1850accd8a2ed32ef627f1a4
BLAKE2b-256 51a6bf1dd6afbabcaf5b19329a1899168c0391d82e99f0cba28db2da1614907b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page