(pronounced "spike-ble")
Installation
From PyPI:
pip install spikeble
From GitHub:
pip install git+https://github.com/MGross21/spikeble.git
Note:
spikebleships type stubs (.pyi) for the SPIKE MicroPython modules (app,color,color_matrix,color_sensor,device,distance_sensor,force_sensor,hub,motor,motor_pair,orientation,runloop). Editors get auto-complete and type checking, but the modules are not importable on your computer; they only exist on the hub. Pyright/Pylance may warn that an import "could not be resolved from source"; silence it withreportMissingModuleSource = false.
Running Code on SPIKE
spikeble.run(main) uploads the body of main() to the hub without running it locally, so all MicroPython imports must go inside main(). Use the template below as a starting point for your SPIKE code:
import spikeble
import asyncio
def main():
# from app import sound, bargraph, display, linegraph, music
import color
import color_matrix
import color_sensor
import device
import distance_sensor
import force_sensor
from hub import port, button, light, light_matrix, motion_sensor, sound
import motor
import motor_pair
import orientation
import runloop
### Insert Your Code Here ###
if __name__ == "__main__":
asyncio.run(spikeble.run(main))
Note:
As ofSPIKE™ Firmware v1.8.149andRPC v1.0.47, usingimport apporfrom app import ...will result in an import error. Theappmodule is currently disabled until further notice.
Other Send Methods
You can also run code on the SPIKE using the following methods:
spikeble.run_file("path/to/your_script.py")
spikeble.run_str("print('Hello from SPIKE!')")
Documentation
Updating the Stubs
The stubs in stubs/ are generated from LEGO's official SPIKE App help content. To regenerate them, or to check whether they are out of date:
python scripts/gen_stubs.py
python scripts/gen_stubs.py --check
Metadata
Release files for spikeble 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spikeble-0.2.0.tar.gz | 20.2 kB | With provenance | Details for spikeble-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spikeble-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for spikeble-0.2.0-py3-none-any.whl |
Total release size: 53.7 kB
Release files / spikeble-0.2.0.tar.gz
| Download URL | spikeble-0.2.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f28bd31c594a60482300151b51b8145355018e8a4a6ee84f93647508f0aa89f
|
|
BLAKE2b-256 checksum How to use checksums |
fff31f1dd132230c2c0bda3fdb724b57137013ae231fdb2ef303d6ae01c8976f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / spikeble-0.2.0-py3-none-any.whl
| Download URL | spikeble-0.2.0-py3-none-any.whl |
|---|---|
| Size | 33.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd4ecc0f15bbfd05b831184dffc527dabec8f5c08899bccff9dffbdc7608a7c9
|
|
BLAKE2b-256 checksum How to use checksums |
b00b1fe313e30f4bfcf5e8299b57bd3b4788bf54eb286f94987f268b838c959e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for spikeble 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for spikeble-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.