PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive tasks.

Overview

PyAutoEasy

PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive tasks.

When PyAutoGUI offers powerful ways to control keyboard and mouse movements, PyAutoEasy makes it super easy to grab the cursor positions on the screen and give meaningful names to them and generate the boilerplate program which we can easily modify to suit our needs.

How to install

Thanks to pip! its as simple as :

pip install --upgrade pip
pip install pyautoeasy

Example Usage

Step 1 : Generate initial code after grabbing the required locations in the screen

  1. Open a terminal / command prompt and run
pyautoeasy
  1. Move your cursor to the desired location and press alt+r in the keyboard to record the coordinates of a point in the screen.
  2. This opens up a dialog box, Now give a name to this point and click OK.
  3. Repeat the above 2 steps for all the cursor locations that you want to grab.
  4. Press alt+s to generate your initial automation script. (sample.py)

Step 2 : Modify the generated sample script to suit your needs.

Lets say you wanna create a login automation. Follow step 1 to record all desired locations in the screen like email field, password field, submit button etc. The generated sample program would look something like this.

from pyautoeasy import ScreenPoint

email_field = ScreenPoint(pos=(952, 309))
email_field.click_here()

password_field = ScreenPoint(pos=(934, 438))
password_field.click_here()

submit_button = ScreenPoint(pos=(1127, 597))
submit_button.click_here()

Now you can take above generated file and easily modify it to something like this. Super easy and intuitive!

from pyautoeasy import ScreenPoint

email_field = ScreenPoint(pos=(952, 309))
email_field.click_here()
email_field.type_here("[email protected]")

password_field = ScreenPoint(pos=(934, 438))
password_field.click_here()
password_field.type_here("password@123")

submit_button = ScreenPoint(pos=(1127, 597))
submit_button.click_here()

More about ScreenPoint

  • A ScreenPoint object represents a point in your screen with (x,y) cordinates specified in the pos argument in the constructor.

point1 = ScreenPoint(pos=(34, 78))

  • We can use the ScreenPoint object to move the curser there, click on that point, type something there, right click on that point etc. These operations can be done easily by using the following methods :
point1 = ScreenPoint(pos=(34, 78))
point1.click_here() # click on this point
point1.right_click_here() # right click on this point
point1.cursor_here() # move the cursor to this point
point1.type_here("text to type") # type something after selecting this point.
point1.double_click_here() # double click on this point
point1.triple_click_here() # triple click on this point
  • By default all the operations in ScreenPoint class is done after a delay of `ScreenPoint.Config.delay' (defaults to 1 second). We can change this property gloabally as follows

ScreenPoint.Config.delay = 0.5

  • Alternatively we can even have a delay specified at each operation by passing the argument after_sleeping_for.
point1 = ScreenPoint(pos=(34, 78))
point1.click_here(after_sleeping_for=0.5) # click on this point after a delay of 0.5 seconds
point1.right_click_here(after_sleeping_for=0) # right click on this point after a delay of 0 seconds.
  • type_here() method can take an optional argument enter=True which would press an enter key after typing the text. By default enter=True
Comments
  • Add dragTo funtionality between points.

    Add dragTo funtionality between points.

    point1 = ScreenPoint(pos=(23,67))
    point2 = ScreenPoint(pos=(239, 88))
    point1.dragTo(point2)
    

    something like this wold be useful. we can use the dragTo function present in pyautgui

    good first issue hactoberfest 
    opened by dingusagar 25
  • Alternate way to execute the interactive program to grab cursor locations.

    Alternate way to execute the interactive program to grab cursor locations.

    Currently we just need to run pyautoeasy in terminal/cmd to start this. But there are cases when the path to this program is not currently set while users are trying to install this package. So as a backup option, we should be also able to call the interactive program like this.

    python -m pyautoeasy
    
    opened by dingusagar 1
  • default shortcuts not working on windows

    default shortcuts not working on windows

    the default shortcuts while running pyautoeasy - alt+r and alt+s are not working in windows. This is because in windows, the alt key is detected as Key.alt_l

    bug 
    opened by dingusagar 1
  • Test this library on macOS and report any issues if found.

    Test this library on macOS and report any issues if found.

    This issue is really to test if its working as expected in a macOS. i have tested it on linux and windows. But if you can create any interesting use-case for testing, you can add the automation script to examples folder and create a pull request.

    good first issue hactoberfest 
    opened by dingusagar 0
  • General Feedback on PyAutoEasy

    General Feedback on PyAutoEasy

    This thread can be used to provide general feedback on this library. It can be positive or negative. Any form of general suggestions/ improvements can also be discussed here. Any specific discussions on new feature requests or resolving bugs can be done in seperate issues. Treat this as a casual thread to throw in any feedbacks. :)

    feedback 
    opened by dingusagar 0
  • Cool Feature to have : Initalise ScreenPoint from text using an ocr engine.

    Cool Feature to have : Initalise ScreenPoint from text using an ocr engine.

    Somthing like this.

    point1 = ScreenPoint.from_text("Search")
    

    Internally it should

    1. grab the screenshot of the screen (can be done using pyautogui.screenshot())
    2. do OCR to identify the texts in the screen. (can tesseract or any other library ?)
    3. find the bounding box which best matches the text. get the center of this box and use that as coordinates to initialise ScreenPoint object.
    enhancement 
    opened by dingusagar 0
Owner
Dingu Sagar
the Engineer
Dingu Sagar
Automated mouse clicker script using PyAutoGUI and Typer.

clickpy Automated mouse clicker script using PyAutoGUI and Typer. This app will randomly click your mouse between 1 second and 3 minutes, to prevent y

Joe Fitzgibbons 0 Dec 1, 2021
Auto Click by pyautogui and excel operations.

Auto Click by pyautogui and excel operations.

Janney 2 Dec 21, 2021
A simple python script that uses selenium(chrome web driver),pyautogui,time and schedule modules to enter google meets automatically

A simple python script that uses selenium(chrome web driver),pyautogui,time and schedule modules to enter google meets automatically

null 3 Feb 7, 2022
Thin-wrapper around the mock package for easier use with pytest

pytest-mock This plugin provides a mocker fixture which is a thin-wrapper around the patching API provided by the mock package: import os class UnixF

pytest-dev 1.5k Jan 5, 2023
a wrapper around pytest for executing tests to look for test flakiness and runtime regression

bubblewrap a wrapper around pytest for assessing flakiness and runtime regressions a cs implementations practice project How to Run: First, install de

Anna Nagy 1 Aug 5, 2021
A wrapper for webdriver that is a jumping off point for web automation.

Webdriver Automation Plus ===================================== Description: Tests the user can save messages then find them in search and Saved items

null 1 Nov 8, 2021
A complete test automation tool

Golem - Test Automation Golem is a test framework and a complete tool for browser automation. Tests can be written with code in Python, codeless using

null 486 Dec 30, 2022
Command line driven CI frontend and development task automation tool.

tox automation project Command line driven CI frontend and development task automation tool At its core tox provides a convenient way to run arbitrary

tox development team 3.1k Jan 4, 2023
Obsei is a low code AI powered automation tool.

Obsei is a low code AI powered automation tool. It can be used in various business flows like social listening, AI based alerting, brand image analysis, comparative study and more .

Obsei 782 Dec 31, 2022
Generic automation framework for acceptance testing and RPA

Robot Framework Introduction Installation Example Usage Documentation Support and contact Contributing License Introduction Robot Framework is a gener

Robot Framework 7.7k Jan 7, 2023
A folder automation made using Watch-dog, it only works in linux for now but I assume, it will be adaptable to mac and PC as well

folder-automation A folder automation made using Watch-dog, it only works in linux for now but I assume, it will be adaptable to mac and PC as well Th

Parag Jyoti Paul 31 May 28, 2021
A browser automation framework and ecosystem.

Selenium Selenium is an umbrella project encapsulating a variety of tools and libraries enabling web browser automation. Selenium specifically provide

Selenium 25.5k Jan 1, 2023
Headless chrome/chromium automation library (unofficial port of puppeteer)

Pyppeteer Pyppeteer has moved to pyppeteer/pyppeteer Unofficial Python port of puppeteer JavaScript (headless) chrome/chromium browser automation libr

miyakogi 3.5k Dec 30, 2022
✅ Python web automation and testing. 🚀 Fast, easy, reliable. 💠

Build fast, reliable, end-to-end tests. SeleniumBase is a Python framework for web automation, end-to-end testing, and more. Tests are run with "pytes

SeleniumBase 3k Jan 4, 2023
Selenium-python but lighter: Helium is the best Python library for web automation.

Selenium-python but lighter: Helium Selenium-python is great for web automation. Helium makes it easier to use. For example: Under the hood, Helium fo

Michael Herrmann 3.2k Dec 31, 2022
Integration layer between Requests and Selenium for automation of web actions.

Requestium is a Python library that merges the power of Requests, Selenium, and Parsel into a single integrated tool for automatizing web actions. The

Tryolabs 1.7k Dec 27, 2022
Flexible test automation for Python

Nox - Flexible test automation for Python nox is a command-line tool that automates testing in multiple Python environments, similar to tox. Unlike to

Stargirl Flowers 941 Jan 3, 2023
Python version of the Playwright testing and automation library.

?? Playwright for Python Docs | API Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright del

Microsoft 7.8k Jan 2, 2023
Network automation lab using nornir, scrapli, and containerlab with Arista EOS

nornir-scrapli-eos-lab Network automation lab using nornir, scrapli, and containerlab with Arista EOS. Objectives Deploy base configs to 4xArista devi

Vireak Ouk 13 Jul 7, 2022