qmk-via-api
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.
Metadata
Release files for qmk-via-api 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qmk_via_api-0.10.0.tar.gz | 42.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| qmk_via_api-0.10.0-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| qmk_via_api-0.10.0-cp38-abi3-win32.whl | CPython 3.8 | abi3 | Windows x86-32 | Details |
| qmk_via_api-0.10.0-cp38-abi3-manylinux_2_38_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.38+ x86-64 | Details |
| qmk_via_api-0.10.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| qmk_via_api-0.10.0-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 2.1 MB
Release files / qmk_via_api-0.10.0.tar.gz
| Download URL | qmk_via_api-0.10.0.tar.gz |
|---|---|
| Size | 42.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c3852aba340f07168c7d37ecb373235f67b5915ef8ce23948f882f3b082f850
|
|
BLAKE2b-256 checksum How to use checksums |
b42cfac6327059c33cea20af6e8be915292e907a9d1aae7272d486f99381c310
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / qmk_via_api-0.10.0-cp38-abi3-win_amd64.whl
| Download URL | qmk_via_api-0.10.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 303.0 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
373573a7ace0837f225a912c2ef386208ae1d76567fab275b8d651a29a368da9
|
|
BLAKE2b-256 checksum How to use checksums |
7e2b6491701e8d77c3d3b1c3de771e0d587af706bf368784cf466ba0378f53ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / qmk_via_api-0.10.0-cp38-abi3-win32.whl
| Download URL | qmk_via_api-0.10.0-cp38-abi3-win32.whl |
|---|---|
| Size | 271.6 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
e429e754737c17e6d5e11a3cff2640fb6c8d524f33a4bbddf508a5a180e3c3f7
|
|
BLAKE2b-256 checksum How to use checksums |
d77469b012c40958d9d86e83b710011ea6d23f4134a0903c22120fe86cc12b7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / qmk_via_api-0.10.0-cp38-abi3-manylinux_2_38_x86_64.whl
| Download URL | qmk_via_api-0.10.0-cp38-abi3-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 598.3 kB |
| Tags | CPython 3.8 Linux glibc 2.38+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1d76665133c1caeb1c3e9acd4d599a1769b34188200bf3b3abdd63a50904ee0b
|
|
BLAKE2b-256 checksum How to use checksums |
4b1ff6f71e2a9d69ac360670dcbdbe146ea3b01c1a709084a0bc0c92845442a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / qmk_via_api-0.10.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | qmk_via_api-0.10.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 435.4 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
653d148ac0e4757806a11f724915aa39b83c38f6a6d273113efaa4b9c87b4b50
|
|
BLAKE2b-256 checksum How to use checksums |
6b2ddf8a641ae48bf9d77192a50f495c50073f8073d0a489d3245a4c31c39f38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / qmk_via_api-0.10.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | qmk_via_api-0.10.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 424.5 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
00190034f84efdf98004ea2f144a5b4101b564ee55466a9195b42d5e9699c180
|
|
BLAKE2b-256 checksum How to use checksums |
144ae58bdc5cf2d3c23f135211c43c7207a63cb7000954653bdd98a4a601287c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|