form-filler: The Python Bookmarklet Generator That Turns YAML Into One-Click Browser Muscle Memory

A tiny developer tool that replaces extension bloat with a clean pipeline: schema-validated specs, generated JavaScript, and instant form population in the browser.

6 to 7 min read • View on GitHub • More from hamatti

A wide black-ink illustration shows a Python notebook page feeding a narrow YAML strip into a browser window. Inside the browser, a simple form is being filled by a single bookmarklet click, with checkboxes toggling and text fields populating in sequence. It explains that the project is a bridge from structured spec to browser action, not a full application.
The whole project is a pipeline: describe the form once, then let the browser do the repetitive work.
Key Takeaways

Most teams would reach for a browser extension. `form-filler` does the opposite. It takes the same repetitive pain and shrinks it into a Python-to-bookmarklet pipeline that is portable, inspectable, and small enough to understand in one sitting.

That restraint is the point. Juha-Matti Santala’s own framing is blunt: "I’m building a Python script to create form filling bookmarklets". The headline sounds modest because the idea is modest. Yet the architecture quietly rejects extension installs, backend services, and UI layers that would add more weight than value.

Why This Exists: The Anti-Extension Answer

If you fill the same developer or test forms over and over, the friction is not the typing. It is the ceremony around the typing. Extensions need install steps, permissions, and maintenance. Bigger automation stacks bring even more surface area. `form-filler` asks a sharper question: what if the answer were just a bookmark you click?

I’m building a Python script to create form filling bookmarklets

A WSJ-style hedcut portrait of Juha-Matti Santala based on his verified GitHub avatar. It identifies the author behind the project and gives the article a human anchor without inventing a new image.

From YAML to Bookmarklet

The workflow is almost absurdly clean. A YAML file defines fields, selectors, and values. Python validates the spec, maps each entry to a JavaScript fragment, and wraps everything in a bookmarklet-friendly shell: javascript:(function(){ ... })();.

A YAML file becomes browser behavior by passing through validation, type dispatch, and a bookmarklet wrapper.

This is not string concatenation dressed up as tooling. The generator is closer to a tiny compiler. It accepts a constrained input language, checks that the input is structurally valid, and emits a browser-native artifact that can be copied anywhere a bookmark can live.

def build_bookmarklet(snippets: list[str]) -> str:
    body = ";".join(snippets)
    return f"javascript:(function(){{{body}}})();"

The interesting design choice is not JavaScript. It is Python as the build language for browser behavior. That keeps the author in a familiar, testable environment while producing something the browser already knows how to run.

The Guardrails: Why Schema Validation Matters

The repo uses Cerberus to validate both the overall file and each input entry. That matters because a bookmarklet fails in the least forgiving place possible: inside the browser, after you have already clicked it. Validation moves the failure earlier, where it is easier to debug and cheaper to fix.

In other words, the schema is the product. It defines what counts as a supported input, which selectors are acceptable, and which values can be translated into working JavaScript. Without that layer, the tool would be a brittle text emitter. With it, the project behaves like a tiny, purpose-built compiler pipeline.

schema = {
    'inputs': {
        'type': 'list',
        'schema': {
            'type': 'dict',
            'schema': {
                'type': {'type': 'string', 'allowed': ['text', 'checkbox', 'date']},
                'selector': {'type': 'string', 'required': True},
                'value': {'required': True},
            },
        },
    }
}

The payoff is practical. A malformed selector gets caught before a user pastes broken code into a bookmark bar. An unsupported field type is rejected instead of silently becoming a bad script. That is a small amount of ceremony that buys real reliability.

The Clever Part Is the Boring Part

The generator’s map is deliberately narrow. Text fields set `.value`. Checkboxes set `.checked`. Dates become strings the browser can accept. The code does not try to infer intent. It just turns each declared field into the most direct possible DOM mutation.

A close-up black-ink illustration shows malformed YAML fragments stopped by a schema gate on the left, while clean inputs pass through and become sharp JavaScript tokens on the right. The image explains that the project works because it validates and narrows input before emitting code.
The hard part is not generating JavaScript. It is refusing bad input before it becomes a bad bookmarklet.

That restraint is what makes the tool legible. Every supported input is obvious. Every emitted line can be read. There are no hidden heuristics, no model prompts, no helper runtime. The bookmarklet does exactly what the YAML said it should do, which is why the pipeline feels trustworthy.

Why Bookmarklets Still Win in Narrow Workflows

Bookmarklets are old, but they are good at one thing: being there without asking for permission. For a developer-owned form, that is enough. They are cross-browser, easy to share, easy to inspect, and easy to throw away when the test case changes.

ApproachInstall burdenTransparencyPortabilityBest fit
Bookmarklet generatorNone beyond a bookmarkHigh. The output is plain JavaScriptHigh. Works wherever bookmarks workRepeatable internal forms and test data
Browser extensionInstall, permissions, updatesMedium. Behavior lives inside an extensionMedium. Browser-specific packaging can matterBroader automation across many sites
AI form fillerInstall plus model dependenceLow. Behavior can be opaqueMedium. Often tied to a service or extensionAd hoc filling when field structure is unclear

The tradeoff is equally clear. Bookmarklets are not the right answer for complex single-page app flows, cross-origin iframes, or messy dynamic state. But this project never pretends otherwise. It wins in the narrower zone where control, repeatability, and portability matter more than generality.

A Tiny Tool With a Modern Toolchain

The stack is small, but it is not sloppy. `uv`, `pyproject.toml`, type hints, `pytest`, and Cerberus all point to a project that wants to be minimal without being throwaway. Even the forward-leaning Python target signals curiosity about the language rather than nostalgia for older habits.

That is an underrated lesson in developer tooling. Small utilities do not have to look provisional. They can be exact, testable, and opinionated while still staying tiny enough to audit by eye.

What It Suggests About Developer Tools

`form-filler` argues for a quieter kind of software. Not every workflow needs a platform. Some need a compact artifact, generated from a declarative spec, that can be inspected, shared, and discarded without ceremony.

That is why the project lands. It solves a browser problem without becoming a browser product. It replaces a stack with a single click, and in doing so it makes a strong case for small tech in the places where small tech is enough.