Skip to main content

manul (Python)

Browser automation in plain English — for humans and LLM agents.

pip install manul-browser

The distribution is manul-browser; the import stays manul. The wheel carries the engine binary and installs the manul command, so there is nothing else to install except a system Chrome/Chromium or Firefox.

Use

import manul

with manul.Session() as s:
    s.step("NAVIGATE to https://example.com")
    s.step("CLICK the 'Sign in' button")
    s.step("FILL 'Email address' field with 'ada@example.com'")

    print(s.map().labels())
    print(s.read("Order total").value)

No selectors, no waits, no page objects. Targets are named the way a person would name them, and the engine resolves them with deterministic DOM heuristics.

Firefox

A launch starts Chromium. Ask for Firefox and the same script runs there, over WebDriver BiDi instead of CDP:

with manul.Session(browser="firefox", headless=True) as s:
    s.step("NAVIGATE to https://example.com")

MANUL_BROWSER=firefox does the same from the environment.

Drive a Chrome you already have open

Start Chrome with --remote-debugging-port=9222, then:

with manul.Session(mode="attach") as s:
    print(s.state()["url"])

That browser stays open when the session ends — Manul did not open it. This is the one difference between the modes that surprises people, so it is worth saying twice.

Mode can also come from configuration, which is what you want when the same script runs locally and in CI:

export MANUL_BROWSER_MODE=attach
export MANUL_CDP_ENDPOINT=http://127.0.0.1:9222

Precedence is Session(...) arguments › environment › manul.config.json › defaults.

Variables persist across steps

This is why Session is a session and not a series of one-shot commands:

with manul.Session() as s:
    s.step("NAVIGATE to https://shop.example.com/cart")
    s.step("EXTRACT the 'Order total' into {total}")

    print(s.vars()["total"])          # "142.50"

    s.set_vars(coupon="SPRING")
    s.step("FILL 'Coupon' field with '{coupon}'")

Run a whole script

with manul.Session() as s:
    result = s.run(path="checkout.hunt")
    print(result.passed, "/", result.total_steps)

A hunt that fails a step raises EngineError with code == "step_failed" and the step's error as the message — unlike step(), which returns a failed outcome. The session stays open. To get failures back as data, run hunts with run_suite, whose SuiteHunt entries carry ok, failed and error.

MOCK rules and variables a hunt sets outlive it: they stay in the session for every later step and run.

Custom controls

Some things a page does cannot be said as "click the thing called X": a canvas signature pad, a third-party date picker, a widget that only answers synthetic events. A custom control claims one target and takes over whenever a step aims at it — the .hunt file keeps saying what it means, and the awkwardness stays in one Python function.

import manul

@manul.custom_control(page="Checkout", target="Signature Pad")
def sign(ctx):
    ctx.eval("document.querySelector('#pad').dispatchEvent(new Event('sign'))")

with manul.Session() as s:
    s.step("CLICK the 'Signature Pad'")     # your function runs instead

page is the page's document.title — not a name from the pages/ registry. Leave it out and the control applies everywhere; a page-specific handler beats a wildcard. Lookup ignores case and extra whitespace on both.

ctx carries target, action, value, page, step and vars, plus eval(js) and current_url() for reaching into the live page. Those two work while the engine is paused mid-step, which the ordinary session methods deliberately do not — calling s.map() from inside a handler is refused rather than deadlocking.

A handler that raises fails that step. The session stays open.

CALL

CALL HOST reaches ordinary Python functions from a .hunt script. CALL PYTHON is the same command, so either spelling keep working.

@manul.call("compute_total")
def compute_total(ctx):
    return str(sum(float(a) for a in ctx.args))
CALL PYTHON compute_total with args: "12" "30" into {total}

Return an object and its keys become variables; return a scalar and it lands in into {var}.

Handlers register at import time and are published to the engine when a session opens, so a decorator does not need a session to exist yet.

Suite hooks

A hunt's own [SETUP] / [TEARDOWN] covers one file. These cover a whole run — logging in once for twenty hunts, tearing an environment down afterwards.

@manul.before_all
def login(ctx):
    ctx.set("token", fetch_token())     # every hunt now sees {token}

@manul.after_all
def cleanup(ctx):
    drop_test_database()

@manul.before_group("smoke")
def seed(ctx):
    reset_fixtures()

Run them with run_suite, which is not a loop over run(): only the engine parses @tags:, so only it can decide which group hooks a hunt belongs to.

with manul.Session() as s:
    result = s.run_suite(["checkout.hunt", "search.hunt"])
    print(result.passed, "/", result.total, "-", result.skipped, "skipped")

Failure behaviour differs per hook, deliberately:

Hook On failure
before_all the suite aborts; no hunt runs. after_all still fires.
before_group those hunts are skipped; the rest of the suite runs.
after_all, after_group reported, changes no result

Cleanup that stops halfway leaves more behind than it saves, so the after_* hooks always run every handler.

before_all runs before any browser exists, so ctx.eval is unavailable there and says so rather than returning nothing.

Errors

A step that resolves nothing is not an exception — it is an outcome to react to:

out = s.step("CLICK the 'Checkout' button")
if not out:
    print(out.reason, out.near)      # why, and what was nearby

Exceptions are reserved for things that are actually wrong:

Exception Meaning
EngineNotFound the binary could not be located; the message lists everywhere it looked
ProtocolError the engine died, or speaks a protocol major version this package predates
EngineError the engine rejected the request (.code is bad_request, not_open, …). Recoverable — the session stays usable
SessionClosed a call was made after close()

What this package is

A thin client. It ships the engine binary, starts it, and speaks a JSON protocol over stdio. The scoring, the .hunt DSL and the CDP transport live in the engine — one implementation, shared with the Go API and the CLI.

That means Python and Go cannot drift apart on what a step does, which is the whole reason the project has one core.

Pointing at your own build

manul.Session(binary="/path/to/manul")            # explicit

or MANUL_BINARY=/path/to/manul. Resolution order: the binary argument, $MANUL_BINARY, the copy bundled in the wheel, then manul on PATH. A candidate that is not a file is skipped, not an error — a mistyped binary path quietly falls through to the next one, and EngineNotFound is raised only when every candidate is missing. Check find_binary() if in doubt.

binary also accepts a sequence when the engine needs a wrapper:

manul.Session(binary=["docker", "exec", "-i", "web", "manul"])

Development

cd bindings/python
python -m pytest tests/

The tests run against a fake engine that speaks the protocol, so they need neither Chrome nor a compiled binary and finish in under a second.

Metadata

Release files for manul-browser 0.1.6

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

Source distribution (sdist)

Source distribution for manul-browser 0.1.6
File Size Uploaded Provenance Actions
manul_browser-0.1.6.tar.gz 27.2 kB With provenance Details for manul_browser-0.1.6.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for manul-browser 0.1.6
File Actions
manul_browser-0.1.6-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for manul_browser-0.1.6-py3-none-win_arm64.whl
manul_browser-0.1.6-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for manul_browser-0.1.6-py3-none-win_amd64.whl
manul_browser-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux musl 1.1+ x86-64 Details for manul_browser-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl
manul_browser-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl Python 3 none Linux musl 1.1+ ARM64, Linux glibc 2.17+ ARM64 Details for manul_browser-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
manul_browser-0.1.6-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for manul_browser-0.1.6-py3-none-macosx_11_0_arm64.whl
manul_browser-0.1.6-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details for manul_browser-0.1.6-py3-none-macosx_10_9_x86_64.whl

Total release size: 37.8 MB

Release files / manul_browser-0.1.6.tar.gz

Download URL manul_browser-0.1.6.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fd39667197aeaf25c033b8da0e0c23eba10fb992266fdf5956e4d840e545998b
BLAKE2b-256 checksum
How to use checksums
6724cbe85b6bce59cc91b7791ec8c27b8cac1e90a6fc16acc9a61620f8ea8c6c
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 26, 2026.

Transparency log

Release files / manul_browser-0.1.6-py3-none-win_arm64.whl

Download URL manul_browser-0.1.6-py3-none-win_arm64.whl
Size 5.9 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
29fba4dffac3dcdeac65498992fe803982310ea06b2d3ed0f3eb698498382654
BLAKE2b-256 checksum
How to use checksums
a8419a8cd55fbf984cbb60815d1c3cf22fc969f114309550bce70947e69f4871
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 26, 2026.

Transparency log

Release files / manul_browser-0.1.6-py3-none-win_amd64.whl

Download URL manul_browser-0.1.6-py3-none-win_amd64.whl
Size 6.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
4604aecc56ae32bf871c68f7fe8810c383c013282d481745da6eae716a0b82ff
BLAKE2b-256 checksum
How to use checksums
5b993199be7f67cad51a43dd20c689d5c531e819cbc25f7937ebd82490c8af0d
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 26, 2026.

Transparency log

Release files / manul_browser-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl

Download URL manul_browser-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Size 6.5 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
af28fbdfbe96c85407f0322ac1eacf6a8fbfdd05740bd50eb8e5973152e3fa26
BLAKE2b-256 checksum
How to use checksums
2d7f9bf701ae3747ba4a6f777be4fbd698e9b40fc4ca7ca9b76b7fa1795b80c2
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 26, 2026.

Transparency log

Release files / manul_browser-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl

Download URL manul_browser-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Size 5.9 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
490f214bae5f7cb014902ab8082e4ba86d7b92fab223b2d02d08dd85b6506776
BLAKE2b-256 checksum
How to use checksums
6c4a356a7a43a9e066d99fa6ef98c9ff021ac6a9acebe38dc763f4c2f5f874ef
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 26, 2026.

Transparency log

Release files / manul_browser-0.1.6-py3-none-macosx_11_0_arm64.whl

Download URL manul_browser-0.1.6-py3-none-macosx_11_0_arm64.whl
Size 6.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a2ca77383e527434ee9a17383a05bcf70d310a1d5f82cd8fb38a02d13af0e59f
BLAKE2b-256 checksum
How to use checksums
5ba9fefcd04b5b329111aead1e2f51b626a3e1066533d35f90803aff81d36375
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 26, 2026.

Transparency log

Release files / manul_browser-0.1.6-py3-none-macosx_10_9_x86_64.whl

Download URL manul_browser-0.1.6-py3-none-macosx_10_9_x86_64.whl
Size 6.7 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f4dfeab61bde9c29415877cafb52da555c3fd55517bd6a28823f5edebf8fe6b0
BLAKE2b-256 checksum
How to use checksums
772d00d7eb65ad952c91f6ae78eefe698074557dcf78309b8a4e782a9a46ba34
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 26, 2026.

Transparency log

Security for manul-browser 0.1.6

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

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for manul_browser-0.1.6.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 26, 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