Skip to main content

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

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
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

  1. 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:

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!

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

apparser-1.1.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apparser-1.1.0-py3-none-any.whl (78.0 kB view details)

Uploaded Python 3

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

Hashes for apparser-1.1.0.tar.gz
Algorithm Hash digest
SHA256 24cdbe596438ebca5ece86e3484ef519027036bb1e5e60929422d18f742bbe9d
MD5 2ee59077a63158d1a8fb8afda08a5b5a
BLAKE2b-256 c525ec08c4a5b0991ced32feb86c0822eb32ac78bc783fde60f63645f8224858

See more details on using hashes here.

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

Hashes for apparser-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8380fa21777e78c28778df7b002c97716efd2397ee741f06a4f4c2997789df8a
MD5 4ccce069ebd6848908691f08175dcacb
BLAKE2b-256 30b00758c6f1918adfd1315c3acd3a5deccb70ec58c06bfe3c76e6935efd5702

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page