Skip to content

apparser-development/apparser

Repository files navigation

License - BSD 3-Clause unit_tests
PyPI Downloads Documentation
PyPI GitHub Issues

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 with base OCR model
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

Disclaimer: This example is provided for educational purposes only to demonstrate UI automation concepts. Do not use it with Counter-Strike 2, Steam, multiplayer games, VAC-protected games, ranking/progression systems, or any application/service where automation is prohibited by its terms of service. This project is not affiliated with, endorsed by, or sponsored by Valve, Steam, or Counter-Strike 2.

  1. Open CS2 and start a game

Code

from apparser import App
from apparser.instructions import OCRAlgorithm
from apparser.instructions.ocr import WaitText, ClickOnText

# 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)
])

# 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' work:

Donation link

For Developers

  1. If something doesn't work, open an issue.
  2. If you want something fixed, open an issue.
  3. If you can help with the library, email us.

apparser.development@gmail.com

Contributions are welcome!

About

Apparser is a Python library for automating desktop applications and interacting with UIs using AI-powered tools such as OCR and object detection models.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages