Skip to main content

Monkey see, monkey do

msmd lets you draw a rectangle over text on a macOS screen, recognizes that region with Apple's built-in Vision framework, and emits the recognized characters as keyboard events. An amber border remains around the capture region while OCR and typing are active.

The first release targets macOS. Capture, OCR, and keyboard output are separate interfaces so Linux and Windows adapters can be added without changing the text tracking or command-line flow.

Use this only on sites and accounts where automation is permitted. Automated results are not meaningful typing scores and may violate a site's rules.

Install with uv

Install uv and make sure your Python build has Tk support. Then let uv create and synchronize the managed project environment:

uv sync

There is no environment activation step. Run commands through uv run so uv uses the locked project environment.

On first use, macOS will ask for two permissions for your terminal or Python:

  • Screen & System Audio Recording, so the selected pixels can be captured.
  • Accessibility, so keyboard events can be sent to the browser.

Enable them under System Settings → Privacy & Security, then quit and relaunch the terminal if macOS does not apply the permission immediately.

Run

Start with a dry run to verify OCR without typing:

uv run msmd --dry-run

Then run a single capture:

uv run msmd

The interaction is:

  1. Drag a rectangle tightly around the typing-test text.
  2. Press Enter to confirm it, or Esc to cancel.
  3. During the three-second countdown, click the browser's typing area.
  4. Keep the target field focused while the recognized characters are emitted.

For a test whose viewport changes or scrolls, use experimental continuous mode:

uv run msmd --continuous --typing-delay 0.01

Stop continuous mode with Ctrl+C in the launching terminal. The tracker uses exact overlap between consecutive OCR frames and waits for two matching frames before accepting a completely replaced viewport. This reduces duplicate typing, but OCR mistakes or animated layouts can still produce incorrect input.

For a typing test with a fixed time limit, --duration implies continuous mode and stops automatically after the requested number of seconds. The timer starts after the focus countdown:

uv run msmd --duration 30
uv run msmd --duration 60 --typing-delay 0.01

Useful options:

--countdown SECONDS       Time available to focus the browser
--typing-delay SECONDS    Delay after each generated character
--scan-interval SECONDS   Delay between continuous OCR frames
--duration SECONDS        Stop continuous OCR after this many seconds
--language LANGUAGE       Vision language, such as en-US or de-DE

Current limitations

  • Region selection currently targets the primary display.
  • OCR quality depends on contrast, font size, animation, and the selected bounds.
  • Unicode events work for ordinary typing-test text, but a site that requires physical key codes may need a keyboard-layout-aware writer later.
  • Continuous mode is intentionally conservative but cannot guarantee that noisy OCR will never retype text.

Development

uv sync
uv run pytest

Platform-neutral behavior lives in core.py; macOS-specific screenshot, Vision, and keyboard implementations live in platforms/macos.py. A future Linux adapter can use X11/Wayland capture plus Tesseract, while Windows can use Windows Graphics Capture plus Windows OCR without changing the rest of the application.

Download files

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

Source Distribution

msmd-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

msmd-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file msmd-0.1.0.tar.gz.

File metadata

  • Download URL: msmd-0.1.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for msmd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1aadfe57802940e39ca96fda0120cf9e14be0e3df7020c142d7ea5970806ca53
MD5 1cc6ed2d2f757d29b3f258601efc2aee
BLAKE2b-256 5e83c45afd9e2fdbe161dffde56143729c62261c752a3e6d8534cfa7844b53a0

See more details on using hashes here.

File details

Details for the file msmd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: msmd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for msmd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b278774916f62c16216c86546383543a3acdda31fc4a7fe0438a2ae2cee89fb2
MD5 9ce518fce758fa9f6dbe3c344fcda3e3
BLAKE2b-256 6555d4dff757f7cbbf6e4ffcd98ee53e096afaad27688b64cec8ff7a012ddf18

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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