My personal Python Tuuls :-)
Project description
PyTu
My personal Python Tuuls :-)
Install & init
> pip install pytu
from pytu.tools import Tools # general python tools
from pytu.matt import Matt # GUI autoMATion tool based on PyAutoGUI
Logging
Tools.log('Hello world') # prints "[2022-02-07 16:31:14] Hello world"
Tools.log_path = "log/{year}-{month}-{day}_{hour}.log" # from now log messages are also saved in text file
Type conversions
Tools.str(datetime.now()) # "2022-02-07 16:31:14"
Tools.str("5.1234000") # "5.1234"
Tools.str(ValueError('something went wrong')) # "ValueError: something went wrong"
Tools.datetime('7.2.2022') # datetime(2022, 2, 7)
Tools.datetime('2/7/2022') # datetime(2022, 2, 7)
Tools.datetime('2022-07-02') # datetime(2022, 2, 7)
Automation
# Init
matt = Matt(
cache_file = 'temp/cache/matt.json',
logger = Tools,
)
matt.set_ui({ # recommended, but not mandatory
'btn_ok' => 'ui/btn_ok.png',
'btn_home' => 'ui/btn_home.png',
'msg_ok' => 'ui/msg_ok.png',
'msg_error' => 'ui/msg_error.png',
'homescreen' => 'ui/homescreen.png',
})
# Automate
matt.click('btn_ok')
found = matt.which(['msg_ok', 'msg_error']) # waits for one of the messages to show up
if found == 'msg_error':
print('Error message found')
elif found == 'msg_ok':
matt.click('btn_home')
matt.wait('homepage')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytu-0.1.5.tar.gz
(5.0 kB
view details)
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
pytu-0.1.5-py3-none-any.whl
(5.2 kB
view details)
File details
Details for the file pytu-0.1.5.tar.gz.
File metadata
- Download URL: pytu-0.1.5.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
576675ed6d3956d427793d02fb4d7baee28f6cc0785c9392b4ba0fc2b45d6fd7
|
|
| MD5 |
bd72d23af15599e2bbafb77b53146f96
|
|
| BLAKE2b-256 |
92a86e0908aa22243a1ffea13407e8b3c7dd5456a18948a6fdd5daa51e0d05c4
|
File details
Details for the file pytu-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pytu-0.1.5-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
056db69de66abfbb5f979d9b717eb5c8974851b8f1c3b9c6645d597d90057a07
|
|
| MD5 |
ed3ab0a896163205050adfd330a0ef2e
|
|
| BLAKE2b-256 |
a559e79c05fcac7d2be558709fac26823a01fd71f1d2c543df8497dfa35cfd41
|