Skip to main content

A Python utility for simulating human-like mouse movement and task switching — useful for automation, UI testing, and system interaction simulations.

Project description

HMI-Sim

A Python utility for simulating human-like mouse movement and task switching — useful for automation, UI testing, and system interaction simulations.

Overview

HMI-Sim (Human-Machine Interaction Simulator) is a lightweight Python script designed to programmatically simulate human input patterns, including dynamic mouse movements and application switching via keyboard shortcuts.

It provides an easy way to mimic basic input activity for development, testing, or automation workflows where synthetic interaction is required — such as simulating user behavior for demos, system monitoring tools, or GUI test environments.

Features

  • 🖱️ Mouse cursor movement with configurable speed and motion paths
  • ⌨️ Programmatic taskbar app switching using Win + [Number]
  • 🔁 Periodic activity simulation with randomized timing
  • 🔊 Optional voice-based feedback (Windows only)
  • ⚙️ Simple configuration via config.ini file with randomized ranges for natural variability
  • 🧪 CLI support with optional simulation duration

Use Cases

  • UI interaction testing
  • Automation workflows
  • Development of interaction-based tools
  • Demos requiring simulated user activity
  • Triggering activity-aware system tools

Note: HMI-Sim is intended for use in testing, automation, and simulation workflows. It is not intended for deceptive use.

Installation

Install via pip:

pip install hmi-sim

Or clone the repository and run directly:

git clone https://github.com/rohitlal125555/hmi-sim.git
cd hmi_sim
python cli.py

Usage

You can run the simulator directly from the command line:

hmi-sim --duration <time>

Duration Format

You can control how long the simulation runs using the --duration argument. Supported formats:

  • s for seconds (e.g., 30s, 90s)
  • m for minutes (e.g., 5m, 10m)
  • h for hours (e.g., 1h, 2h)

If you omit the --duration flag, the simulation runs indefinitely until manually stopped.

To stop: press Ctrl + C.

Configuration

All simulation configuration settings are defined in the config.ini file, which is automatically created on first run.

📂 Config file path:

``~/.hmi-sim/config.ini
  • On Windows, this resolves to: %USERPROFILE%\.hmi-sim\config.ini
  • On Linux/macOS, this resolves to: $HOME/.hmi-sim/config.ini

Sample config.ini:

[Settings]
; If enabled, the program speaks the app # and num mouse movements chosen for the sim
enable_audio = False

; Enable random clicks
enable_random_clicks = False

; Sleep time between each simulation
sleep_time_range = 30, 60

; Range of apps on task bar to switch between. For eg: 1 - means 1st icon on taskbar
taskbar_apps_range = 2, 6

; Number of intra-simulation mouse movements
num_mouse_movements = 1, 4

; Speed of mouse movement. For eg: 2 - means the mouse movement will take 2s to complete
mouse_movement_speed = 1, 3

You can adjust these ranges to suit your testing or simulation scenarios.

Requirements

  • Python 3.9+
  • Required Libraries:
    • pyautogui
    • pywin32 (only if enable_audio = True)

Install dependencies manually (if cloned):

pip install pyautogui pywin32

Disclaimer

This tool is provided for automation and testing purposes only.

The author assumes no responsibility for any unintended use of this utility. Users are expected to comply with all applicable laws, policies, and ethical standards.

License

Licensed under the Apache License 2.0.

Contributing

Contributions, suggestions, and improvements are welcome! Please open an issue or submit a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hmi_sim-1.0.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hmi_sim-1.0.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file hmi_sim-1.0.0.tar.gz.

File metadata

  • Download URL: hmi_sim-1.0.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for hmi_sim-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9ee4c47333a3c6341096dc0f69afbf3a39544e72a11715658c3b71224f1ea60c
MD5 dda2c2b149e2a8e27d7f808060637668
BLAKE2b-256 88f887dc13a291847672511b691accf678b9982a2e99370910cce33cfdeb2240

See more details on using hashes here.

File details

Details for the file hmi_sim-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hmi_sim-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for hmi_sim-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66a7cad6e1aac23c111fff56b8bbe8b749cc6762e8570cb7d6720c77c0c8fb5a
MD5 93eeddc5ff10b9f7bd090cf46d3f5391
BLAKE2b-256 f812c9ce565de55216ddb238bd09f49a778034ffaad273711c3970263b4ab097

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page