Apparser is a Python library designed for automating desktop applications and managing UI interfaces using artificial intelligence, such as OCR or object detection models.
Project description
Apparser
Apparser is a Python library for automating desktop applications and interacting with UIs using AI-powered tools such as OCR and object detection models.
Installation
# Base Apparser package
pip install apparser
# Apparser with text recognition support
pip install "apparser[ocr]"
# Apparser with text-to-speech support
pip install "apparser[speak]"
# Apparser with object detection support
pip install "apparser[cv]"
# Apparser with all optional features
pip install "apparser[all]"
Examples
- Open CS2 and start a game
Code
from apparser import App
from apparser.instructions import OCRAlgorithm
from apparser.instructions.ocr import WaitText, ClickOnText
from apparser.text_readers import ScreensController, RapidOcrReader
# Text labels that the OCR algorithm will look for on the screen.
play_button = "play"
deathmatch_button = "deathmatch"
group_button = "hostage group"
start_button = "go"
# Create OCR-based algorithm.
algorithm = OCRAlgorithm([
# Wait for the main menu and open the play screen.
WaitText(play_button),
ClickOnText(play_button),
# Select the deathmatch mode.
WaitText(deathmatch_button),
ClickOnText(deathmatch_button),
# Select the hostage group and start the match.
WaitText(group_button),
ClickOnText(group_button),
ClickOnText(start_button, min_similarity=0.5),
], text_reader=ScreensController(RapidOcrReader()))
# Launch CS2
app = App(['cmd', '/c', 'start', 'steam://rungameid/730'], timeout=20)
# Run the prepared scenario against the application UI.
algorithm.perform(app.ui)
Video
Docs
Full documentation is available here
Package page on PyPI
Donation
If you'd like to financially support the developers for their work:
For Developers
- If something doesn't work, open an issue.
- If you want something fixed, open an issue.
- If you can help with the library, email us.
apparser.development@gmail.com
Contributions are welcome!
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
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
File details
Details for the file apparser-1.1.0.tar.gz.
File metadata
- Download URL: apparser-1.1.0.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24cdbe596438ebca5ece86e3484ef519027036bb1e5e60929422d18f742bbe9d
|
|
| MD5 |
2ee59077a63158d1a8fb8afda08a5b5a
|
|
| BLAKE2b-256 |
c525ec08c4a5b0991ced32feb86c0822eb32ac78bc783fde60f63645f8224858
|
File details
Details for the file apparser-1.1.0-py3-none-any.whl.
File metadata
- Download URL: apparser-1.1.0-py3-none-any.whl
- Upload date:
- Size: 78.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8380fa21777e78c28778df7b002c97716efd2397ee741f06a4f4c2997789df8a
|
|
| MD5 |
4ccce069ebd6848908691f08175dcacb
|
|
| BLAKE2b-256 |
30b00758c6f1918adfd1315c3acd3a5deccb70ec58c06bfe3c76e6935efd5702
|