A SolidPython-based library for building custom keyboards with Python and OpenSCAD.
Project description
SPKB
SolidPython-based Keyboard Builder
A SolidPython-based library for building custom keyboards with Python and OpenSCAD.
Some portions ported from Clojure, originally from the Dactyl Keyboard and my fork thereof, the Dactyl Lynx Keyboard.
Using SPKB
Installing
Simply install the library in your project, using your preferred package manager.
poetry add spkb
PDM:
pdm add
pipenv install spkb
Usage
In your project, you can simply import what you need from the submodules of spkb:
from spkb.switch_plate import plate_thickness, mx_plate
from spkb.board_mount import stm32_blackpill
from spkb.keycaps import sa_double_length, sa_cap
See the sidebar of the documentation for a reference of what's available.
Examples
See the example scripts in the examples/ directory. You can run them by setting PYTHONPATH to include the current
directory:
env PYTHONPATH=$PWD poetry run python examples/stm32_blackpill_mount.py
Developing SPKB
Prerequisites
Installing dependencies
poetry install
Usage
For simply generating interesting key testers, see the example scripts in the examples/
directory.
Running tests
You can run simple tests from some of the submodules:
poetry run python -m spkb.keycaps # Renders the built-in keycap approximations
poetry run python -m spkb.single_key_pcb # Renders a simple approximation of a single-key PCB
poetry run python -m spkb.single_tester # Renders a single-key tester
poetry run python -m spkb.keyswitch.base # Renders a switch socket negative, plate with board mount, and dummy switch shape
poetry run python -m spkb.keyswitch.choc # Renders a switch socket with backplate for a Kailh Choc switch
poetry run python -m spkb.keyswitch.mx # Renders a switch socket with backplate for an MX-style switch
# Deprecated modules
poetry run python -m spkb.switch_plate # Renders a variety of keyswitch plates (sockets)
poetry run python -m spkb.keyswitch # Renders a basic approximation of an MX-style switch body
You can also run all module tests and check for appropriate outputs with this script:
scripts/run-module-tests.sh
Documentation
You can view the documentation online on ReadTheDocs.
You can also view the generated API documentation locally by running pdoc:
poetry run pdoc -n -t templates spkb
Links
- parametric-key-tester - the original project this library was forked from
- the Dactyl Keyboard and my fork, the Dactyl Lynx Keyboard - original switch sockets, keycap approximations, etc.
License
This project is released under the BSD 3-Clause License.
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 Distribution
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 spkb-0.1.1.tar.gz.
File metadata
- Download URL: spkb-0.1.1.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Linux/6.12.3-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
430ccff75bfdb6ceea3210168fcf09f24973b58252df3040ffc939db0679fc54
|
|
| MD5 |
6136af2b0834f22935e7eab9749c0a84
|
|
| BLAKE2b-256 |
751c4628b2c9650c7968c85d1c6ccfed2af7d51676a31993e1ac5c0b2fc51252
|
File details
Details for the file spkb-0.1.1-py3-none-any.whl.
File metadata
- Download URL: spkb-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Linux/6.12.3-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaa3a57ffe93242b4493c032ce88c841ce5041109605ab11f3d3a85c8350af17
|
|
| MD5 |
c2186431f108b19aa3936990901c35eb
|
|
| BLAKE2b-256 |
5ccbbda5bc3dfe9e26824b21658a9c4ab9e03ce5af06e0578d926ecf234f66d0
|