Skip to main content

myuri (Python)

Human-like browser cursor, keyboard, and scroll simulation — driver-agnostic.

myuri generates realistic mouse trajectories (recorded human motion via cursory), fitted scroll dynamics, and Markov-model typing with natural errors and corrections. It does not talk to a browser itself — you inject a small Driver, so it works with Playwright, raw CDP, or any backend you can wrap.

pip install myuri            # core
pip install "myuri[playwright]"  # + the default Playwright driver

Quick start (Playwright)

from myuri import create_cursor
from playwright.async_api import async_playwright

async with async_playwright() as p:
    page = await (await p.chromium.launch()).new_page()
    await page.goto("https://example.com")

    cursor = create_cursor(page, seed=1234)   # PlaywrightDriver inferred
    await cursor.move("#username")
    await cursor.click("#username")
    await cursor.type("hello@example.com")
    await cursor.scroll("#footer")
    await cursor.drag("#card", "#bin")      # selectors or Vector points
    await cursor.dispose()

Bring your own driver

Subclass myuri.Driver (implement the input primitives + evaluate) or assemble one from callables with define_driver:

from myuri import create_cursor, define_driver

driver = define_driver(
    move=my_move, click=my_click, down=my_down, up=my_up,
    wheel=my_wheel, press=my_press, evaluate=my_evaluate,
)
cursor = create_cursor(driver, seed=1234)

my_click(button, click_count) should pass click_count through to the browser (2 and 3 continue a double/triple click). clear_existing triple-clicks to select a field's text, so a click that ignores it can't clear fields.

evaluate(js, arg) receives a JS arrow-function source string and one JSON-serializable argument, and must run it in the page and return the result — the same contract as Playwright's page.evaluate.

Prebuilt wrappers

from_playwright / from_cdp turn a page into a driver, so you can construct directly:

from myuri import create_cursor, from_playwright, from_cdp

cursor = create_cursor(from_playwright(page), seed=1234)
# or dispatch mouse input over CDP on a Chromium page:
cursor = create_cursor(from_cdp(page), seed=1234)

The identity's OS

create_cursor(page, os="macos") (or "windows", "linux") matches the input to the OS the browser claims: the paste and select-all modifier (Cmd on macOS, Ctrl elsewhere), whether a move repeats the position the pointer is already on (only on macOS), the mouse wheel style, and which axis a Shift+wheel scroll carries. How long a person takes is the same on every OS.

Planning without a browser

plan_move, plan_point, plan_click, plan_type, plan_press, plan_select_all and plan_wheel return the timelines a Cursor plays, from an rng such as make_rng(seed); the Cursor is built on them. See the project README.

Smart actions on your own host

Actions(host, rng, os=, parts=, asynchronous=) runs the Cursor's actions (click, scroll into view, type) on any host that can send input and run a page function. Pass parts to replace a step (move, press, point, reaches, into_view, wheel, type, key) and keep the rest. See the project README.

Determinism

Seeded Mulberry32 PRNG — the same seed produces the same numbers as the TypeScript package. Pass seed= to reproduce motion, scrolls, and typing rhythm; read it back with cursor.get_seed().

Part of the Myuri project (TypeScript + Python). Mouse trajectories come from cursory by Vinyzu. Requires Python 3.11+ (cursory's minimum).

Licensed under the GNU LGPL v3 or later. See NOTICE for credits.

Metadata

Release files for myuri 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for myuri 4.0.0
File Size Uploaded Provenance Actions
myuri-4.0.0.tar.gz 80.0 kB With provenance Details for myuri-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for myuri 4.0.0
File Interpreter ABI Platform Actions
myuri-4.0.0-py3-none-any.whl Python 3 none any Details for myuri-4.0.0-py3-none-any.whl

Total release size: 161.1 kB

Release files / myuri-4.0.0.tar.gz

Download URL myuri-4.0.0.tar.gz
Size 80.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5fa5e9100ad3b72cab32a63eb5a51165d7734773e9d707b4775f38e92905a642
BLAKE2b-256 checksum
How to use checksums
532c13c5b1d37318c3fb295fca7f9742c81a349414428e4756a685a967c0eed4
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 18, 2026.

Transparency log

Release files / myuri-4.0.0-py3-none-any.whl

Download URL myuri-4.0.0-py3-none-any.whl
Size 81.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a1f476daa194af4c2aaddf5801972ecb270b46d4a248aa19de0c2fd0716f65f
BLAKE2b-256 checksum
How to use checksums
217a9355763f78993fd5047c41e0c6aeb2ec381fbcdf606b3e32872c22cd61f3
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 18, 2026.

Transparency log

Security for myuri 4.0.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.

Select from 2 files

Attestation for myuri-4.0.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 18, 2026.

Transparency log

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