Skip to main content

A SolidPython-based library for building custom keyboards with Python and OpenSCAD.

Project description

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

Links

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spkb-0.1.1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spkb-0.1.1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

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

Hashes for spkb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 430ccff75bfdb6ceea3210168fcf09f24973b58252df3040ffc939db0679fc54
MD5 6136af2b0834f22935e7eab9749c0a84
BLAKE2b-256 751c4628b2c9650c7968c85d1c6ccfed2af7d51676a31993e1ac5c0b2fc51252

See more details on using hashes here.

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

Hashes for spkb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaa3a57ffe93242b4493c032ce88c841ce5041109605ab11f3d3a85c8350af17
MD5 c2186431f108b19aa3936990901c35eb
BLAKE2b-256 5ccbbda5bc3dfe9e26824b21658a9c4ab9e03ce5af06e0578d926ecf234f66d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page