Skip to main content

Mouselink

Mouselink on PyPI

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)

Source distribution for mouselink 1.0.2
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)

Table of built distributions (wheels) for mouselink 1.0.2
File Interpreter ABI Platform Actions
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

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.

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