Skip to main content

Python RPA library

Project description

iBot-Automation

iBot Automation is a simple cross-platform RPA tool designed to Automate any Business process. It works in MacOSX, Windows and linux

Requirements

  • Python 3.6 and up.

iBot Automation Modules

=================================

  1. Browser - Automate Browser Activities.
  2. DataBase - Create manage and modify databases.
  3. Email - Read and send Emails.
  4. Excel - Create, read and modify Excel workbooks.
  5. Files - Work with Files, folders, images and PDFs.
  6. OCR - Convert images to text.
  7. Robot - Manage Robots, Queues and items.
  8. System - Work with process and system activities.
  9. Word - Create, edit and modify Word documents.
  10. Screen - Find bitmap elements on screen, mouse and keyboard control (move, drag, click and type).

Installation

First, see if a binary wheel is available for your machine by running:

$ pip install iBotAutomation

Another option is to build from the latest source on the GitHub repository:

$ git clone https://github.com/ecrespo66/iBot-Automation.git
$ cd iBot
$ make
$ make install

Browser Automation

Browser automation example

  1. Check your Chrome version by typing Chrome://version in your chrome browser
  2. Download chromeDriver from Chrome driver.
from iBot.browser_activities import * 
# undetectable=True to make browser undetectable to AntiBot systems
PathDriver = "path_to_chrome_driver.exe"
Browser = ChromeBrowser(PathDriver,undetectable=True)
Browser.open()
Browser.get('https://google.com')

DataBase Activities

Insert data example

from iBot.dataBase_activities import Sqlite
pathToDatabase = "c:/sqliteExample.sqlite"
Sqlite= Sqlite(pathToDatabase) 
Data = {"Dg":"Saimon", "Gt":"Manuel"}
tableName = "random"
Sqlite.Insert(tableName,Data)

Email Automation

Read Emails example **enable less secure apps in your email account settings

from iBot.email_activities import Mail
email = 'mail@mail.com'
password = '*******'
Mail = Mail(email, password)
mails= Mail.fetchBox()
for mail in mails:
    print(mail.subject)

Excel Automation

Get value from cell example

from iBot.excel_activities import Excel

path = "Path/to/workbook.xlsx"
workbook = Excel(path)
sheets = workbook.GetSheets()
sheet = sheets[0]
cell = "A1"

value = workbook.readCell(cell, sheet)

Files Activities

Work with files

from iBot.files_activities import File

path = "Path/to/file"
file = File(path)
#rename file
new_file_name = "file2"
file.rename(new_file_name)
#move file
folder = 'path/to/folder'
file.move(folder)

Folder Activities

Work with folders

from iBot.files_activities import Folder
folder = 'path/to/folder'
Carpeta = Folder(folder)
if Carpeta.exists:
    Carpeta.rename("Folder")
    #get list of files
    FileList = Carpeta.fileList
    #get list of subfolders
    FolderList = Carpeta.subFoldersList

Image Activities

Work with Images

from iBot.files_activities import Image
path = 'path/to/folder'
image = Image(path)
# rotate image horizontally
image.mirrorH()
# rotate image vertically
image.mirrorV()
#crop image
image.crop()
#resize image
image.resize((150,250))

PDF Activities

Work with PDFs

from iBot.files_activities import PDF
path = 'path/to/PDF'
pdf = PDF(path)
#get number of pages
print(pdf.pages)
#get pdf info
print(pdf.info)
#Read PDF page 1
text= ''
for i in range(pdf.pages):
    text += pdf.readPage(i) 
print(text)

OCR Activities

Convert images to text

  1. Download latest version of Tesseract from here: tesseract-ocr.
  2. Download training data from tesseract trainning data.
  3. place training data in the following folder ./tesseract/share/tessdata
from iBot.ocr_activities import OCR
path = 'path/to/tesseract-executable' 
ocr = OCR(path)
#convert image to text 
path = 'path/to/picture'
text = ocr.readPicture(path, lang='eng')
print(text)
#convert pdf to text using OCR
filePath = 'path/to/pdf'
#resize images fo a better recognition
scale= 3
text = ocr.readPdf(filePath, scale= scale, lang='spa')
print(text)

Word Activities

Work with Word Documents

from iBot.word_activities import Word

#Instance Word Object
document = Word("path_to_word_document")
#add heading to word document
document.addHeading("Lorem Ipsum is simply dummy text of the printing and typesetting industry.", 0)
#add paragraph to word document
paragraph = ''' 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
'''
document.addParagraph(paragraph)
#add picture to word document
document.addPicture('path_to_picture', 300, 300)
table = [('one', 'two', 'three'), (112, 122, 123)]
document.addTable(table)
#read word document
document.read()
#convert word to pdf
document.convertToPdf()

Screen Activities

Find screen elements on the screen, mouse and keyboard activities

from iBot.screen_activities import Screen
#instance Screen object
screen = Screen()
#find element
element = screen.FindElement('path/to/element.png')
#move mouse to position
screen.moveMouseTo(element)
#click on position
screen.click()
#keyboard activities
text= "Hello world"
screen.write(text)

Robot Activities

Work with Robot, Queues, Items and Logs in the most simple way

from iBot.robot_activities import Robot
#Instance the Robot Object
RobotName = Robot("name_of_your_robot")

#Create a Queue for your Robot
if not RobotName.findQueuesByName("Name_of_the_queue"):
    Queue1 = RobotName.createQueue("Name_of_the_queue")
else:
    Queue1 = RobotName.findQueuesByName("Name_of_the_queue")[0]

#Add items to your queue
for i in range(0,100):
    Queue1.createItem(i)

#Get items of your queue
while True:
    item = Queue1.getNextItem()
    if not item:
        break
    else:
        item.setItemAsOk()  
    print(item.value,item.status)

Contributing

If you are interested in this project, please consider contributing. Here are a few ways you can help:

License

This project is licensed under either the Apache-2.0 or MIT license, at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for iBotAutomation, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size iBotAutomation-1.1-py3-none-any.whl (37.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size iBotAutomation-1.1.tar.gz (18.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page