Skip to main content

SPKB

SolidPython-based Keyboard Builder

API Documentation on ReadTheDocs Python package

Action Shot

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:

poetry add spkb

PDM:

pdm add

pipenv:

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

License

This project is released under the BSD 3-Clause License.

Metadata

Release files for spkb 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spkb 0.1.1
File Size Uploaded
spkb-0.1.1.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spkb 0.1.1
File Interpreter ABI Platform
spkb-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / spkb-0.1.1.tar.gz

Download URL spkb-0.1.1.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
430ccff75bfdb6ceea3210168fcf09f24973b58252df3040ffc939db0679fc54
BLAKE2b-256 checksum
How to use checksums
751c4628b2c9650c7968c85d1c6ccfed2af7d51676a31993e1ac5c0b2fc51252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Linux/6.12.3-arch1-1

Release files / spkb-0.1.1-py3-none-any.whl

Download URL spkb-0.1.1-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eaa3a57ffe93242b4493c032ce88c841ce5041109605ab11f3d3a85c8350af17
BLAKE2b-256 checksum
How to use checksums
5ccbbda5bc3dfe9e26824b21658a9c4ab9e03ce5af06e0578d926ecf234f66d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Linux/6.12.3-arch1-1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page