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.inifile 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:
sfor seconds (e.g.,30s,90s)mfor minutes (e.g.,5m,10m)hfor hours (e.g.,1h,2h)
If you omit the
--durationflag, 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:
pyautoguipywin32(only ifenable_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ee4c47333a3c6341096dc0f69afbf3a39544e72a11715658c3b71224f1ea60c
|
|
| MD5 |
dda2c2b149e2a8e27d7f808060637668
|
|
| BLAKE2b-256 |
88f887dc13a291847672511b691accf678b9982a2e99370910cce33cfdeb2240
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66a7cad6e1aac23c111fff56b8bbe8b749cc6762e8570cb7d6720c77c0c8fb5a
|
|
| MD5 |
93eeddc5ff10b9f7bd090cf46d3f5391
|
|
| BLAKE2b-256 |
f812c9ce565de55216ddb238bd09f49a778034ffaad273711c3970263b4ab097
|