Form Filler is a tool that turns a yaml specification into a bookmarklet for filling in forms with demo data.
This is handy for development of web apps.
Start by creating a specification for your form.
To create a new bookmarklet, create a new YAML file in specifications.
The data format is as follows:
inputs:
field_1: # This name can be anything that helps you understand
type: text # see below for available types
value: example # this varies between types, see below
selector: "#field" # a CSS selector that identifies your input
# ... repeat for all the fieldsValid for:
emailhiddennumberpasswordsearchtelweek
value can be pretty much anything, it will be converted to its string representation
Valid for:
checkbox
value should be either true or false. Any truthy value will become true and any falsy value will become false
Valid for:
date
Currently needs to be in YYYY-MM-DD format.
Install the packages or run with poetry or uv or similar.
uv sync
uv run src/form-filler.py specifications/example.yamlCopy the output into a new bookmarklet. I usually create a bookmark folder per form and then create a variety of bookmarklets for different scenarios.
In demo/, there's an example form that gets filled by a bookmarklet created from specifications/example.yaml spec for playing around.
The project relies on two external dependencies:
- Cerberus is used to validate YAML specifications
- PyYAML is used to parse YAML specifications into Python data structures
To run tests, run
uv run pytest