ruanyf / weekly

科技爱好者周刊,每周五发布
47.54k stars 2.87k forks source link

[第 72 期] TagUI for Python - Python package for digital process automation (RPA) #726

Open kensoh opened 5 years ago

kensoh commented 5 years ago

Hi Yi Feng,

I got to know your blog from one of your readers. I'm following Automagica project and saw that there is recent new jump in users. So I reach out to ask some new users how do they know about the tool and she told me http://www.ruanyifeng.com/blog/2019/07/weekly-issue-66.html

I'm from Singapore, recently created a Python package with various automation capabilities (web, visual, OCR, keyboard, mouse) in a fun and expressive API - https://github.com/tebelorg/TagUI-Python

It's based on TagUI, a previous project which I created mostly in JS / PHP. For your kind review to see if TagUI for Python would be an interesting project to include in your future newsletter. Thank you very much!

TagUI for Python demo in Jupyter notebook

kensoh commented 5 years ago

Adding examples of its automation use cases (web, visual, OCR, keyboard, mouse) -

import tagui as t

Web automation

t.init()
t.url('https://www.google.com')
t.type('q', 'decentralization[enter]')
t.snap('page', 'results.png')
t.close()

Visual automation

t.init(visual_automation = True)
t.dclick('outlook_icon.png')
t.click('new_mail.png')
...
t.type('message_box.png', 'message')
t.click('send_button.png')
t.close()

OCR automation

t.init(visual_automation = True)
t.echo(t.read('pdf_window.png'))
t.echo(t.read('image_preview.png'))
t.hover('anchor_element.png')
t.echo(t.read(t.mouse_x(), t.mouse_y(), t.mouse_x() + 400, t.mouse_y() + 200))
t.close()

Keyboard automation

t.init(visual_automation = True, chrome_browser = False)
t.keyboard('[cmd][space]')
t.keyboard('safari[enter]')
t.keyboard('[cmd]t')
t.keyboard('avengers[enter]')
t.wait(2.5)
t.snap('page.png', 'results.png')
t.close()

Mouse automation

t.init(visual_automation = True)
t.type(600, 300, 'open source')
t.click(900, 300)
t.snap('page.bmp', 'results.bmp')
t.hover('button_to_drag.bmp')
t.mouse('down')
t.hover(t.mouse_x() + 300, t.mouse_y())
t.mouse('up')
t.close()

And architecture diagram of the project -

architecture

kensoh commented 5 years ago

非常感谢阮一峰先生接受我提交的 Python 模块!

有了比较广大的用户 feedback 后,我会再接再厉把模块做得更好。