Skip to content

UnMars/human_typer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

human_typer

Human Typer

Python package to simulate human keyboard typing

Installation

Use the package manager pip to install human_typer.

pip install human_typer

For Playwright support:

pip install human_typer[playwright]

Usage

from human_typer import Human_typer

My_Typer = Human_typer(keyboard_layout = "qwerty", average_cpm = 190)

# Directly with keyboard
My_Typer.keyboard_type("my text")

# With a Selenium element
my_element = driver.find_element_by_id("ID")
My_Typer.type_in_element("my text", my_element)

# With optional custom typo error rate (default is 0.02 = 2% of every character typed)
My_Typer = Human_typer(keyboard_layout = "qwerty", average_cpm = 190, error_rate = 0.05)

# With a Playwright element (requires: pip install human_typer[playwright])
from playwright.sync_api import sync_playwright

My_Typer = Human_typer(element_type="playwright")
with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto("https://example.com")
    element = page.locator("#my-input")
    My_Typer.type_in_element("my text", element)
    browser.close()

Contributing

Pull requests are welcome 😊

License

MIT

About

Python package to simulate human keyboard typing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages