.. image:: https://raw.githubusercontent.com/py-bots/media-pyles/main/pybots/PyBots%20TriColor%20Logo.png Welcome to My AutoPylot , Made in India with ❤️ ----------------------------------------------- .. image:: https://raw.githubusercontent.com/py-bots/media-pyles/main/autopylot/Auto%20Pylot%20Figlet%20Dark.png What is My-AutoPylot? ===================== PyBots is an Indian firm based in Vadodara, Gujarat. My-AutoPylot is a product developed based on Python. Its a RPA framework for developers and common people to create Software BOTs. Using AI, we’re working on Common Man’s RPA. Installation ============ My-AutoPylot is currently supported on Windows only ! (For macOS and Linux : Comming soon.) Windows : --------- - My-AutoPylot is compatible with both Windows 10 and Windows 11. - Installing on a Windows PC is a breeze. - Make certain that Python 3.8 or Python 3.9 is installed. - Then, from the command prompt, execute the following command. :: pip install -U my-autopylot Importing ========= My-AutoPylot can be accessed using one of two methods. Windows : --------- - Terminal : Opens a Python interpreter using the command " import my-autopylot as ap " :: ap_py - Code Editor or IDE : Import My-AutoPylot first, and then run the file in Python. # ap_bot.py import my_autopylot as ap ap.windows_launch_app('notepad') :: Save the file and run it. Run the file using the command " python ap_bot.py " My-AutoPylot in Action ----------------------- Now access more than 100 functions (hit ctrl+space in your IDE) ================================================================== **TIP:** You can find and inspect all of ClointFusion's functions using only one function i.e., ``find()``. Just pass the partial name of the function. :: ap.find("excel") ap.find("window") 4 functions on Mouse Operations: -------------------------------- +-------------------------------------------------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Function | Accepted Parameters | Description | +=======================================================+====================================================================================+==========================================================================================================================================================================================================================+ | ap.mouse\_click() | x=" ", y=" ", left\_or\_right="left", no\_of\_clicks=1, type\_of\_movement="abs" | Clicks at the given X Y Co-ordinates on the screen using ingle / double / triple click(s). Has an optional argument for which type of movement will take place where values can will be "abs" (default) or it can be"rel"| +-------------------------------------------------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.mouse\_move() | x=" ", y=" ", type_of_movement="abs" | Moves the cursor to the given X Y Co-ordinates. Has an optional argument for which type of movement will take place where values can will be "abs" (default) or it can be"rel". | +-------------------------------------------------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.mouse\_drag\_from\_to() | x1=" ", y1=" ", x2=" ",y2=" " | Clicks and drags from X1 Y1 co-ordinates to X2 Y2 Co-ordinates on the screen | +-------------------------------------------------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.mouse\_search\_snip\_return\_coordinates\_x\_y() | img=" ", wait=180 | Searches the given image on the screen and returns its center of X Y co-ordinates. | +-------------------------------------------------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -------------- 8 functions on Window Operations (works only in Windows OS): ------------------------------------------------------------ +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | Function | Accepted Parameters | Description | +==================================================+=======================+=======================================================+ | ap.window\_show\_desktop() | None | Minimizes all the applications and shows Desktop. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.window\_get\_all\_opened\_titles\_windows() | None | Gives the title of all the existing (open) windows. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.window\_activate\_and\_maximize\_windows() | windowName=" " | Activates and maximizes the desired window. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.window\_minimize\_windows() | windowName=" " | Activates and minimizes the desired window. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.window\_close\_windows() | windowName=" " | Close the desired window. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.windows_launch_app() | pathOfExeFile=" " | Launches any exe or batch file or excel file etc. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.window_get_active_window() | None | Gives the title of the current active window | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ | ap.window_activate_window() | window_title=" " | Activates the window with the given name. | +--------------------------------------------------+-----------------------+-------------------------------------------------------+ -------------- 8 functions on Folder Operations: --------------------------------- +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | Function | Accepted Parameters | Description | +==============================================+================================================================+=============================================================================================================================+ | ap.folder\_read\_text\_file() | txt\_file\_path=" " | Reads from a given text file and returns entire contents as a single list | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.folder\_write\_text\_file() | txt\_file\_path=" ", contents=" " | Writes given contents to a text file | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.folder\_create() | strFolderPath=" " | When you are making leaf directory, if any intermediate-level directory is missing, folder\_create() method creates them. | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.folder\_create\_text\_file() | textFolderPath=" ", txtFileName=" " | Creates text file in the given path. | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.folder\_get\_all\_filenames\_as\_list() | strFolderPath=" ", extension='all' | Get all the files of the given folder in a list. | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.folder\_delete\_all\_files() | fullPathOfTheFolder=" ", file\_extension\_without\_dot="all" | Deletes all the files of the given folder | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.file\_rename() | old\_file\_path='', new\_file\_name='', ext=False | Renames the given file name to new file name with same extension. | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | ap.file\_get\_json\_details() | path\_of\_json\_file='', section='' | Returns all the details of the given section in a dictionary | +----------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ -------------- 3 functions on Keyboard Operations: ----------------------------------- +--------------------------+-------------------------------------------------------------------------------+------------------------------------------------------------------------+ | Function | Accepted Parameters | Description | +==========================+===============================================================================+========================================================================+ | ap.key\_hit\_enter() | write\_to\_window=" " | Enter key will be pressed once. | +--------------------------+-------------------------------------------------------------------------------+------------------------------------------------------------------------+ | ap.key\_press() | key\_1='', key\_2='', key\_3='', write\_to\_window=" " | Emulates the given keystrokes. | +--------------------------+-------------------------------------------------------------------------------+------------------------------------------------------------------------+ | ap.key\_write\_enter() | text\_to\_write=" ", write\_to\_window=" ", delay\_after\_typing=1, key="e" | Writes/Types the given text and press enter (by default) or tab key. | +--------------------------+-------------------------------------------------------------------------------+------------------------------------------------------------------------+ -------------- 5 functions on Screen-scraping Operations: ------------------------------------------ +-------------------------------------------------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Function | Accepted Parameters | Description | +=======================================================+=====================================================================+===============================================================================================================================================================================+ | ap.scrape\_save\_contents\_to\_notepad() | folderPathToSaveTheNotepad=" ", switch\_to\_window=" ",X=0, Y=0 | Copy pastes all the available text on the screen to notepad and saves it. | +-------------------------------------------------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.scrape\_get\_contents\_by\_search\_copy\_paste() | highlightText=" " | Gets the focus on the screen by searching given text using crtl+f and performs copy/paste of all data. Useful in Citrix applications. This is useful in Citrix applications | +-------------------------------------------------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.screen\_clear\_search() | delay=0.2 | Clears previously found text (crtl+f highlight) | +-------------------------------------------------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.search\_highlight\_tab\_enter\_open() | searchText=" ", hitEnterKey="Yes", shift\_tab='No' | Searches for a text on screen using crtl+f and hits enter. This function is useful in Citrix environment. | +-------------------------------------------------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.find\_text\_on\_screen() | searchText=" ", delay=0.1, occurance=1, isSearchToBeCleared=False | Clears previous search and finds the provided text on screen. | +-------------------------------------------------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -------------- 11 functions on Browser Operations: ----------------------------------- +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | Function | Accepted Parameters | Description | +===================================+========================================================================================+=================================================================+ | driver = ap.ChromeBrowser() | None | To initialise a ChromeBrowser class. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.open_browser() | url=" ", dummy\_browser=True, incognito=False, profile="Default" | Function to launch browser and start the session. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.navigate() | url=" " | Navigates to Specified URL. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.write() | Value=" ", User\_Visible\_Text\_Element=" " | Write a string on the given element. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.mouse_click() | User\_Visible\_Text\_Element=" ", element=" ", double\_click=False, right\_click=False | Click on the given element. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.browser_locate_element_h() | selector=" ", get\_text=False, multiple\_elements=False | Find the element by Xpath, id or css selection. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.wait_until() | text=" ", element="t" | Wait until a specific element is found. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.refresh_page() | None | Refresh the page. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.close() | None | Close the Helium browser. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.hit_enter() | None | Hits enter KEY using Browser Helium Functions | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.key_press() | key\_1=" ", key\_2=" " | Type text using Browser Helium Functions and press hot keys | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.mouse_hover() | User\_Visible\_Text\_Element=" " | Performs a Mouse Hover over the Given User Visible Text Element | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ | driver.scroll() | direction="down", weight="100" px | Scrolls the browser window. | +-----------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------+ -------------- 3 functions on String Operations: --------------------------------- +--------------------------------------------+-----------------------+--------------------------------------------------+ | Function | Accepted Parameters | Description | +============================================+=======================+==================================================+ | ap.string\_remove\_special\_characters() | inputStr=" " | Removes all the special character. | +--------------------------------------------+-----------------------+--------------------------------------------------+ | ap.string\_extract\_only\_alphabets() | inputString=" " | Returns only alphabets from given input string | +--------------------------------------------+-----------------------+--------------------------------------------------+ | ap.string\_extract\_only\_numbers() | inputString=" " | Returns only numbers from given input string | +--------------------------------------------+-----------------------+--------------------------------------------------+ -------------- 18 functions on Excel Operations: --------------------------------- +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | Function | Accepted Parameters | Description | +====================================================+===========================================================================================================================+============================================================================================+ | ap.excel\_get\_all\_sheet\_names() | excelFilePath=" " | Gives you all names of the sheets in the given excel sheet. | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_create\_excel\_file\_in\_given\_folder() | fullPathToTheFolder=" ", excelFileName=" ", sheet\_name="Sheet1" | Creates an excel file in the desired folder with desired filename | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_if\_value\_exists() | excel\_path=" ", sheet\_name="Sheet1", header=0, usecols=" ", value=" " | Check if a given value exists in given excel. Returns True / False | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_copy\_paste\_range\_from\_to\_sheet() | excel\_path=" ", sheet\_name="Sheet1", startCol=0, startRow=0, endCol=0, endRow=0, copiedData=" " | Pastes the copied data in specific range of the given excel sheet. | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_get\_row\_column\_count() | excel\_path=" ", sheet\_name="Sheet1", header=0 | Gets the row and column count of the provided excel sheet. | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_copy\_range\_from\_sheet() | excel\_path=" ", sheet\_name="Sheet1", startCol=0, startRow=0, endCol=0, endRow=0 | Copies the specific range from the provided excel sheet and returns copied data as a list | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_split\_by\_column() | excel\_path=" ", sheet\_name="Sheet1", header=0, columnName=" " | Splits the excel file by Column Name | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_split\_the\_file\_on\_row\_count() | excel\_path=" ", sheet\_name = "Sheet1", rowSplitLimit=" ", outputFolderPath=" ", outputTemplateFileName ="Split" | Splits the excel file as per given row limit | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_merge\_all\_files() | input\_folder\_path=" ", output\_folder\_path=" " | Merges all the excel files in the given folder | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_drop\_columns() | excel\_path=" ", sheet\_name="Sheet1", header=0, columnsToBeDropped = " " | Drops the desired column from the given excel file | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_clear\_sheet() | excel\_path=" ",sheet\_name="Sheet1", header=0 | Clears the contents of given excel files keeping header row intact | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_set\_single\_cell() | excel\_path=" ", sheet\_name="Sheet1", header=0, columnName=" ", cellNumber=0, setText=" " | Writes the given text to the desired column/cell number for the given excel file | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_get\_single\_cell() | excel\_path=" ",sheet\_name="Sheet1", header=0, columnName=" ",cellNumber=0 | Gets the text from the desired column/cell number of the given excel file | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_remove\_duplicates() | excel\_path=" ",sheet\_name="Sheet1", header=0, columnName=" ", saveResultsInSameExcel=True, which\_one\_to\_keep="first" | Drops the duplicates from the desired Column of the given excel file | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_get\_all\_header\_columns() | excel\_path=" ",sheet\_name="Sheet1",header=0 | Gives you all column header names of the given excel sheet | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_describe\_data() | excel\_path=" ",sheet\_name="Sheet1",header=0 | Describe statistical data for the given excel | +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.isNaN() | value | Returns TRUE if a given value is NaN False otherwise | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | ap.excel\_to\_colored\_html() | formatted\_excel\_path=" " | Converts given Excel to HTML preserving the Excel format and saves in same folder as .html | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ Some of miscellaneous functions related to emoji, capture photo, flash (pop-up) messages etc: ---------------------------------------------------------------------------------------------- +-------------------------------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Function | Accepted Parameters | Description | +===========================================+====================================================================================================+========================================================================================================================================================================================================+ | ap.clear\_screen() | None | Clears Python Interpreter Terminal Window Screen | +-------------------------------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.print\_with\_magic\_color() | strMsg:str=" ", magic:bool=False | Function to color and format terminal output | +-------------------------------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.show\_emoji() | strInput=" " | Function which prints Emojis | +-------------------------------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.download\_this\_file() | url=" " | Downloads a given url file to BOT output folder or Browser's Download folder | +-------------------------------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ap.pause\_program() | seconds="5" | Stops the program for given seconds | +-------------------------------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ We love your contribution ========================= Contribute to us by giving a star, writing articles on ``My AutoPylot``, giving comments, reporting bugs, bug fixes, feature enhancements, adding documentation, and many other ways. Invitation to our Monthly Branded Hackathon ------------------------------------------- We also invite everyone to take part in our monthly branded event, the ``My AutoPylot Hackathon``, and stand a chance to work with us. Checkout our Hackathon Website for more details here: `My AutoPylot Hackathon `__ Date ❤️ with My AutoPylot ------------------------- This an initiative for fast track entry into our growing workforce. For more details, please visit: `Date with My AutoPylot `__ Acknowledgements ---------------- We sincerely thanks to all it's dependent packages for the great contribution, which made ``My AutoPylot`` possible! Please find all the dependencies Credits ------- Need help in Building BOTS? --------------------------- Write us at My support@pybots.ai