Skip to content

A Python library for parsing the serialized format used on keyboard-layout-editor.com (KLE).

License

Notifications You must be signed in to change notification settings

hajimen/pykle_serial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Python library for parsing the serialized format used on keyboard-layout-editor.com (KLE).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages