VIA api implementation for QMK-based keyboards
Project description
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() {
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");
}
}
Disable Python Bindings
The python feature flag is enabled by default. In projects that don't interoperate with Python, the Python bindings can be disabled by turning off default features. In Cargo.toml:
[dependencies]
qmk-via-api = { version = "0.3.0", default-features = false }
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 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")
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qmk_via_api-0.5.0.tar.gz.
File metadata
- Download URL: qmk_via_api-0.5.0.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b69f16fe053c0817b415323c59d67f2b5f445a84c461a971a9952b9b15b37e5f
|
|
| MD5 |
548417a06d9fd8b031e9457b0f082184
|
|
| BLAKE2b-256 |
4a26aab9322337967d9cb4447ac59d054fb0a7a3f7560eb6c5decdf088fc0fb5
|
File details
Details for the file qmk_via_api-0.5.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: qmk_via_api-0.5.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 194.6 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65d9fc811d0ed8f95f743ea540d9b1dc0aa5c4c5f0856f43f71876b61a2d10cb
|
|
| MD5 |
2fba61244844f8e2a8a6a371834f6ee4
|
|
| BLAKE2b-256 |
ed436554972cdad3721317870236963baf0e3b4e2c31eefb9a6a693ca85fd2c2
|
File details
Details for the file qmk_via_api-0.5.0-cp38-abi3-win32.whl.
File metadata
- Download URL: qmk_via_api-0.5.0-cp38-abi3-win32.whl
- Upload date:
- Size: 179.2 kB
- Tags: CPython 3.8+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82cb3491088f4fd99ec3c4aa50469e7ef0dd3ae4a10c7b4db2fb2b585930bec8
|
|
| MD5 |
5b164bd7a81e925d103e6b143efd48bb
|
|
| BLAKE2b-256 |
26971d2e1155c7becab11c3f225fa5ae3a80fc978280e675351d46bf42a2dc7e
|
File details
Details for the file qmk_via_api-0.5.0-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: qmk_via_api-0.5.0-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 453.6 kB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e1087776adfe27a561ec5881bce14b6e153fd4ed2c47812d121acc366db53eb
|
|
| MD5 |
892108d0f37e6a6c1ad042422f5c647a
|
|
| BLAKE2b-256 |
90c35d928c0488605432e1e23f2e937bbdcdefe74bc8d8870b9f57bea843635a
|
File details
Details for the file qmk_via_api-0.5.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: qmk_via_api-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 300.8 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
685a131e63cb0b7b78750bc34d5412c7c124f0a66dd43f222acfdac93268a16e
|
|
| MD5 |
0935243ddaf3f9cb8b6e271dce483365
|
|
| BLAKE2b-256 |
814908e1d9b96137f3ac05ae02983ccee871e4a20419c216984b1e3981554071
|
File details
Details for the file qmk_via_api-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: qmk_via_api-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 309.0 kB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae856f9bf42695a3d90c14e59e4d4c7a68c877b97e1217aeb2732599877b0e6
|
|
| MD5 |
719a0f1f7f2faa665fc987bdadd6107f
|
|
| BLAKE2b-256 |
2c0568951b5eab16d24b58345b011e61f646f19325d301d41f4f6ea1b29008cb
|