Mouselink
Mouselink is a Python package that emulates Scratch Link, which enables Scratch to connect to hardware peripherals such as a micro:bit or an EV3. Mouselink tricks Scratch into thinking that it is Scratch Link, and allows you to connect Scratch to more then their small selection of hardware peripherals, and to software as well!
Installation
To install it, use:
python -m pip install mouselink
You can use the example code found in the examples directory or copy the code below:
from mouselink import mouselink as sl
p = sl.ev3()
def on_got_data(data):
print(f"Got data: {data}")
p.send(f"1{data}0") # send back data with some additional data
p.on_read(on_got_data)
p.run()
Features (and planned ones)
Implemented:
- Add an EV3 to the device list
- Allow Scratch to connect to that EV3
- Transmit data as that EV3
Planned
- Support connecting as other peripherals
- micro:bit
- WeDo 2.0
- Communication using the Translate extention's data saving glitch
How does it work?
I investigated Scratch's communication with Scratch Link, and discovered it uses a plain, unencrypted WebSocket server. I own an EV3, so I used my web browser's developer tools to monitor the data sent between Scratch and Scratch Link. I then began writing Mouselink, using my real EV3 communication as reference for the protocol. After a few days, I could connect an emulated EV3 device and have it be recognised by Scratch, and a few days after that I could transmit data between Scratch and Mouselink.
Metadata
Release files for mouselink 1.0.2
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 |
|---|---|---|---|---|
| mouselink-1.0.2.tar.gz | 214.6 kB | Without provenance | Details for mouselink-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mouselink-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for mouselink-1.0.2-py3-none-any.whl |
Total release size: 219.8 kB
Release files / mouselink-1.0.2.tar.gz
| Download URL | mouselink-1.0.2.tar.gz |
|---|---|
| Size | 214.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68d8b327cfd0e71e33462edba9bd78952c11f10263e2f46a04486e1b7bab1f45
|
|
BLAKE2b-256 checksum How to use checksums |
2c18f852b0c61a685774e4fd68f6501b24f42e91947372a91c988d15802f47dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Release files / mouselink-1.0.2-py3-none-any.whl
| Download URL | mouselink-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f65c1940dc1e632718f8174844108da80ad167ec26b6cd3b86950c60796262cc
|
|
BLAKE2b-256 checksum How to use checksums |
b3072452b63c2d593086d80c84617f4a0ae6d07786d3a44eb669fe80658e5958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Security for mouselink 1.0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.