Skip to main content

Clone your repetitive PC tasks

Project description

pccloner

When you execute a task on your PC, it captures mouse and keyboard actions, including the cursor's position and a preceding screenshot. You can then replay the captured task whenever desired.

Supported Features:

  • Capable of replaying double clicks and drag motions.
  • Designed to replay almost all keystrokes (please report any unsupported key).
  • Tested on Ubuntu 20.04 and Windows 11.
  • Supports all hotkeys and sequences of hotkeys (please report any unsupported hotkey).
  • It records and replays the cursor trajectory before each keyboard and mouse event. This is important for activating some functionality by putting the cursor over a screen region.

Conditions for Optimal Performance: The stored task must be replayed on the same computer, and the screen's initial state during replay should closely resemble the initially stored screen state.

Known Issues:

  • On Ubuntu 20.04:
    1. Occasionally, the collector registers one extra scroll action than required, which does not accurately replicate the task.
    2. At replaying time, pushing buttons to write over "Show Applications" does not work. The written words are sent to terminal.
    3. If you use a hidden bar of tasks, then the replayer cannot activate it even fi this action was recorded.
  • On Windows 11:
    1. Scrolling isn't detected when using a touchpad; please use a mouse instead.
    2. The function (fn) key is not recognized, but detected.
    3. The alt_gr key can generate sequences of pairs (alt_gr + ctrl_l), leading to unnecessary storage of screenshots.
  • Sometimes, in the process of minimizing a window, the size and location of the window are different w.r.t the original stored task. The replayer could fail in this case.

Authors

Installation

pip install pccloner

On ubuntu: it requires to install gnome-screenshot.

sudo apt install gnome-screenshot

Usage

  1. Write a python script with following lines:
File: collector.py

from pccloner.pcdata import Collector

if __name__ == '__main__':
    pc = Collector()
    data_df = pc.start()
  1. Run the previous script python collector.py
  2. Press the ESC key to start recording. And don't forget to press again the ESC key to terminate the recording. This code will create a folder called "data" where it will save all the data related to your task.
  3. Use the next code to replay your previous stored task python replayer.py -p [YOUR_PATH_TO_CSV_FILE]. At replaying, you can exit the process pressing ESC.
File: replayer.py

from glob import glob 
from pccloner.pctask import Replayer
import pandas as pd
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-p', '--csvpath', help="path to the task data")
parser.add_argument('--viz', action=argparse.BooleanOptionalAction, default=False, help="To visualize actions")
parser.add_argument('--screen', action=argparse.BooleanOptionalAction, help="True means that it uses the current screenshots to visualize actions")
parser.add_argument('--mousemoves', action=argparse.BooleanOptionalAction, help="True means that cursor movements before each event is performed (except to drags events)")

args = parser.parse_args()

if not args.csvpath:
   print(glob('data/*/*.csv'))
   print('Select your stored task using the argument -p to give the path')
else: 
   sample = pd.read_csv(args.csvpath)
   task1 = Replayer(sample, data_dir='./')
   task1.execute(viz=args.viz, screen_flag=args.screen, mousemoves_flag=args.mousemoves)

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

pccloner-0.0.20.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

pccloner-0.0.20-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file pccloner-0.0.20.tar.gz.

File metadata

  • Download URL: pccloner-0.0.20.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pccloner-0.0.20.tar.gz
Algorithm Hash digest
SHA256 2d17bdc8fd70de4f4f706422724338b313f18a4c6952bd7c601bfaabc55f0742
MD5 f47e8ea8efbd085d5546284451200fde
BLAKE2b-256 5eb1c3663dded8841bb7fd144111d08d71b8b7538c39f87c0309358e2bfc52ee

See more details on using hashes here.

File details

Details for the file pccloner-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: pccloner-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pccloner-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 6d0c868cb9fedbd2c73ed3c6a344564f1b5a184a118d23042252eff1d04bc9f9
MD5 75735c04fd0fd0d6f80ad0a006c8d3b1
BLAKE2b-256 4ae08a8ca16abed64d9770c57c435b226f5d830c87cc5d11913ad881a31b3c57

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