Skip to main content

An AI-powered Python package for natural, human-like mouse and keyboard control.

Project description

🐝 Bumblebee – Human-Like Mouse & Keyboard Controller

Bumblebee Logo

Bumblebee is an AI-powered Python package that provides realistic, human-like control of the mouse and keyboard. Unlike traditional automation tools, Bumblebee leverages deep learning to predict natural movement patterns, resulting in automated interactions that feel organic and smooth.


✨ Features

  • AI-Powered Cursor Movement:
    Utilizes an RNN augmented with an LSTM layer to generate smooth, human-like mouse trajectories. These paths are enhanced with natural noise and variable speeds, creating movements that closely mimic real human behavior.

  • Smart Keystroke Simulation:
    Simulates typing with natural delays, realistic punctuation handling, and variability in keystroke timing to emulate human typing patterns.

  • Extensive Training Data:
    Trained on a dataset of over 25,000 real cursor movements to ensure high realism and accuracy.

  • Reinforcement Learning (Coming Soon):
    Future updates will incorporate RL to further enhance cursor behavior, enabling more diverse and adaptive movement patterns.


🚀 How It Works

🖱️ Cursor Movement

Bumblebee predicts the cursor path using an RNN-LSTM model trained on extensive real-world cursor data. This approach avoids the robotic jumps seen in conventional automation tools, ensuring smooth and natural motion.

Currently, Bumblebee's mouse moves on almost the same path if the same initial and destination positions are provided, with some noise.

Coming Soon: An enhanced model incorporating Reinforcement Learning (RL) that will generate different form of paths even if same initial and destination is provided.

⌨️ Keyboard Control

The keyboard simulation is driven by:

  • Mathematical Models:
    Considering distances between keys and natural typing rhythms.
  • Timing Variations:
    Simulated delays for each keystroke to mimic human typing quirks.
  • Punctuation & Special Characters Handling:
    Adjusted behaviors to reflect realistic typing patterns.

🏗️ Under the Hood

  • Simulation:
    Uses PyAutoGUI for executing mouse events and [pynput] (https://pynput.readthedocs.io/) for executing keyboard events.
  • Deep Learning:
    Powered by PyTorch models trained on self-collected datasets of human interactions for predicting intermediate points between starting position and destination.

⚙️ How to Use

  1. Install Bumblebee
pip install the-bumblebee
  1. Import the core modules and use them as following:

Mouse Control Examples

from bumblebee import Mouse

# Initialize controllers
mouse = Mouse()


# Set mouse speed (pixels per second)
mouse.set_speed(1000)

# Move mouse to specific coordinates
mouse.move(100, 200)

# Drag mouse from the current position to a new location
mouse.drag_to(233, 244)

# Simulate a mouse click (button options: "left", "middle", "right", "primary", "secondary")
mouse.click(button="left")

# Move to a position then click
mouse.move_to_and_click(destX=150, destY=250, button="left")

Keyboard Control Example

Initialize the Keyboard controller and adjust its typing behavior:

from bumblebee import Keyboard

# Initialize the Keyboard controller with default parameters:
#   - typing_speed: 100 (default percentage of ideal speed)
#   - consistency: 95 (default consistency percentage, affecting delay variability)
#   - typo_rate: 5 (default typo frequency percentage)
keyboard = Keyboard()

# Adjust typing speed.
# The typing speed is provided as a percentage relative to the original Bumblebee typing speed.
# Acceptable types: int or float.
keyboard.set_speed(new_speed=400)  # Increase the typing speed to 400%

# Adjust typo rate.
# The new typo rate must be a value between 0 and 100 (int or float).
keyboard.set_typo_rate(3)  # Set typo rate to 3%

# Adjust consistency.
# A higher consistency (0-100) increases typing speed with less delay variability.
keyboard.set_consistency(99)  # Set consistency to 99%

# Type a sample text.
text = "Bumblebee is great."
keyboard.type(text)  # 'text' must be a string.

Interested in contributing?

Please take a moment to review our CONTRIBUTING.md file for detailed guidelines on how to join our community and help shape Bumblebee’s future.

🐝 Making automation feel more human, one movement at a time.

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

the_bumblebee-1.0.2.tar.gz (11.9 MB view details)

Uploaded Source

Built Distribution

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

the_bumblebee-1.0.2-py3-none-any.whl (11.9 MB view details)

Uploaded Python 3

File details

Details for the file the_bumblebee-1.0.2.tar.gz.

File metadata

  • Download URL: the_bumblebee-1.0.2.tar.gz
  • Upload date:
  • Size: 11.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for the_bumblebee-1.0.2.tar.gz
Algorithm Hash digest
SHA256 44f6736f1bd0d851a3b1e530766bf8756d4356575adb35e2b5e64d48a69a681c
MD5 d3522398ac7ae25fa9256b1566f31432
BLAKE2b-256 98fc3f410f9468a68efab6f80ba8bdb1a4ec06e311baed1ac70ad2c2a1f9d776

See more details on using hashes here.

File details

Details for the file the_bumblebee-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: the_bumblebee-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for the_bumblebee-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 780c9bb166df12d4f4b4b11402adc9acea7d446bfc7ef525ede52060b57bbfc9
MD5 3566a26654746c4da3ff3a1888c7764e
BLAKE2b-256 f7c460fe3359946943ba379e9b0536cda5c0c4591e99a3f9cb8f70471e2f4dad

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