Skip to main content

VIA api implementation for QMK-based keyboards

Project description

qmk-via-api

Version image image

qmk-via-api provides an implementation of the VIA API for QMK (Quantum Mechanical Keyboard) based keyboards. It allows developers to interact with QMK keyboards programmatically, enabling tasks such as configuring keymaps, macros, lighting effects and more.

Additionally, this library includes Python bindings for all API calls for integration of QMK keyboard configuration into Python-based applications or scripts.

Usage

Rust

Add dependency with Cargo:

cargo add qmk-via-api

Usage example:

use qmk_via_api::{
    api::KeyboardApi,
    scan::scan_keyboards,
};

fn main() -> Result<(), qmk_via_api::Error> {
    let devices = scan_keyboards()?;
    let dev = match devices.first() {
        Some(dev) => dev,
        None => {
            println!("No devices found");
            return Ok(());
        }
    };
    let api = KeyboardApi::from_device(dev)?;

    println!("Protocol version: {:?}", api.get_protocol_version()?);
    println!("Layer count: {:?}", api.get_layer_count()?);

    let original = api.get_key(0, 0, 0)?;
    api.set_key(0, 0, 0, original)?;

    Ok(())
}

Python

Install with pip:

pip install qmk-via-api

Usage example:

import qmk_via_api
from qmk_via_api import scan_keyboards

devices = scan_keyboards()
if not devices:
    print("No devices found")
    raise SystemExit(0)

dev = devices[0]
api = qmk_via_api.KeyboardApi.from_device(dev)

print(f"Protocol version {api.get_protocol_version()}")
print(f"Layers count: {api.get_layer_count()}")

original = api.get_key(0, 0, 0)
api.set_key(0, 0, 0, original)

License & Attribution

Parts of this project are based on code from the VIA project, which is licensed under the GNU General Public License v3.0.

Project details


Download files

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

Source Distribution

qmk_via_api-0.6.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distributions

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

qmk_via_api-0.6.0-cp38-abi3-win_amd64.whl (206.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

qmk_via_api-0.6.0-cp38-abi3-win32.whl (189.6 kB view details)

Uploaded CPython 3.8+Windows x86

qmk_via_api-0.6.0-cp38-abi3-manylinux_2_38_x86_64.whl (468.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.38+ x86-64

qmk_via_api-0.6.0-cp38-abi3-macosx_11_0_arm64.whl (315.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

qmk_via_api-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl (317.0 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file qmk_via_api-0.6.0.tar.gz.

File metadata

  • Download URL: qmk_via_api-0.6.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for qmk_via_api-0.6.0.tar.gz
Algorithm Hash digest
SHA256 38578ed1d92144ef9504ce39f83a0b7bee204d8ac0dad5d8fdf233b61344be48
MD5 313d6a404b6d8d6fed3020aa9ee4d31a
BLAKE2b-256 095c8574eec71d1aaa4c1341c97f972d1f976c7483190001d9aebe56ab565280

See more details on using hashes here.

File details

Details for the file qmk_via_api-0.6.0-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for qmk_via_api-0.6.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 293a22a79b3b3243b240c4d2af9732ef500625e2bbc52b07afa01088055c1ad2
MD5 2eb29f831ab54a67b4bb1e85668fa4bd
BLAKE2b-256 59bd9acf47f609122b979078bfea0c23799e993416a35ae1f5c45586fb28c9b8

See more details on using hashes here.

File details

Details for the file qmk_via_api-0.6.0-cp38-abi3-win32.whl.

File metadata

  • Download URL: qmk_via_api-0.6.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 189.6 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for qmk_via_api-0.6.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 b42bb39b047a14d42fed26b82ddd0c24168807b1bb6ef97c9e8669702f995b07
MD5 efd3cb128dfb0c408bfc1afa1eea548d
BLAKE2b-256 db6721f731902332e591be5c13e46aaeb82574eea426a7e13327ec0dcd297169

See more details on using hashes here.

File details

Details for the file qmk_via_api-0.6.0-cp38-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for qmk_via_api-0.6.0-cp38-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 07eb83a06ba98d2a55faab52d3f3093ce2a7bb361686e5b9354b72e74bb59397
MD5 142c232dee224900045e466685df4a24
BLAKE2b-256 f1fa6d32133534ef29eb36cbafd3c1ade10b040b5c694d9f3684e4198c863eb9

See more details on using hashes here.

File details

Details for the file qmk_via_api-0.6.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qmk_via_api-0.6.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e9e15a3fe7d5f1df6456fb51a2d6378e146be53a1d259b8a3a7ac1e5861f218
MD5 94c59f7aad857aebd122e37ae10b1d3a
BLAKE2b-256 c79bc158eeedaa25c0043317b67686111ec627f31ad4cdab047248e707b764d5

See more details on using hashes here.

File details

Details for the file qmk_via_api-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qmk_via_api-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 95f3091c58f05571cfef1a66b90856b09fd7914cdd2c9668b0225cdc7b062e57
MD5 5bfc1cbb9a131b5f29cb1ead85e49eaf
BLAKE2b-256 1570c3f1f03ba4bc7ba49fa93a4beb3c63ae4cc8190b2cfbbaf73cff52d63b74

See more details on using hashes here.

Supported by

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