| Crates.io | qmk-via-api |
| lib.rs | qmk-via-api |
| version | 0.3.0 |
| created_at | 2024-04-02 19:25:36.683155+00 |
| updated_at | 2025-09-21 17:12:38.796539+00 |
| description | VIA api implementation for QMK-based keyboards |
| homepage | |
| repository | https://github.com/srwi/qmk-via-api |
| max_upload_size | |
| id | 1194183 |
| size | 114,891 |
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.
Add dependency with Cargo:
cargo add qmk-via-api
Usage example:
use qmk_via_api::{api::KeyboardApi, scan::scan_keyboards};
fn main() {
if let Some(dev) = scan_keyboards().first() {
let api = KeyboardApi::new(dev.vendor_id, dev.product_id, dev.usage_page).unwrap();
println!("Protocol version: {:?}", api.get_protocol_version());
println!("Layer count: {:?}", api.get_layer_count());
} else {
println!("No devices found");
}
}
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 devices:
dev = devices[0]
api = qmk_via_api.KeyboardApi(dev.vendor_id, dev.product_id, dev.usage_page)
print(f"Protocol version {api.get_protocol_version()}")
print(f"Layers count: {api.get_layer_count()}")
else:
print("No devices found")
Parts of this project are based on code from the VIA project, which is licensed under the GNU General Public License v3.0.