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:
- Occasionally, the collector registers one extra scroll action than required, which does not accurately replicate the task.
- At replaying time, pushing buttons to write over "Show Applications" does not work. The written words are sent to terminal.
- On Windows 11:
- Scrolling isn't detected when using a touchpad; please use a mouse instead.
- The function (fn) key is not recognized, but detected.
- 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
- Write a python script with following lines:
File: collector.py
from pccloner.pcdata import Collector
if __name__ == '__main__':
pc = Collector()
data_df = pc.start()
- Run the previous script
python collector.py - 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.
- 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
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 pccloner-0.0.16.tar.gz.
File metadata
- Download URL: pccloner-0.0.16.tar.gz
- Upload date:
- Size: 12.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2265e83a7cc8b1bf52773a44b08d0800d5ef847e8398f78a4f1a6a0e912c513
|
|
| MD5 |
c17fdc600a6c2a68b7c88bce76f0d21e
|
|
| BLAKE2b-256 |
691e0f5f6376380606fa4c8c71686cfa008c6b86bbb022d5c8ea762e6bd75c1b
|
File details
Details for the file pccloner-0.0.16-py3-none-any.whl.
File metadata
- Download URL: pccloner-0.0.16-py3-none-any.whl
- Upload date:
- Size: 11.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbba4f7ee2fcc8832b9f5b89a186ac274e58d65021aa75c703d194760138512b
|
|
| MD5 |
2646fb8566da3b995dbd9f8cf74e7fbd
|
|
| BLAKE2b-256 |
649dbac231c680a9cdcfb16aff883cb312fe1d50e0cfd88944e540c1ea2638d3
|