Skip to content

A Python library for interacting with KLE JSON and KLE data structures.

License

Notifications You must be signed in to change notification settings

DamSenViet/kle-py

Repository files navigation

kle-py

A Python library for interacting with KLE JSON and KLE data structures.

Originally ported from keyboard-layout-editor with improvements to make the source code increasingly portable across different language platforms.

Table of Contents

Documentation

To view documentation, examples, visit the documentation site.

Installation

To install and use the library, use the installation method listed below.

pip3 install damsenviet.kle

Quick Start

This quick start demo demonstrates parsing a KLE JSON file.

import os
import json
from damsenviet.kle import Keyboard

# relative to this file
json_relative_file_path = "./keyboard.json"
json_absolute_file_path = os.path.abspath(
    os.path.join(
        os.path.dirname(__file__),
        json_relative_file_path,
    )
)

keyboard = Keyboard.from_json(
    json.load(json_absolute_file_path)
)

for key in keyboard.keys:
    for label in key.labels:
        pass

The schemas for KLE JSON can be found at kle-json.

Contributing

There are many ways to contribute to this project.

For more information please see the contributing guidelines.

About

A Python library for interacting with KLE JSON and KLE data structures.

Resources

License

Stars

Watchers

Forks

Packages

No packages published