Skip to main content

Companion application for library guirecognizer

Project description

guirecognizerapp is the companion application for guirecognizer. It helps create and preview actions and preprocessing operations through a visual interface, before using them in a Python bot.

See documentation with tutorials and examples: https://guirecognizer.readthedocs.io.

Development

Install the dependencies

For the client and its e2e tests.

$ npm install
$ cd client
client$ npm install

Backend

(venv) $ pip install -e ".[dev]"

Launch app

Launch client

$ cd client
client$ npm run dev

Launch server

(venv) $ fastapi dev --port 5174 guirecognizerapp/main.py

Build/Update i18n

For the client, keep the i18n file sorted by key.

$ python scripts/sortJsonFile.py client/messages/en.json

For the backend, on git bash with Babel installed, activate the virtual environment.

$ cd .venv/Scripts
$ . activate
$ cd ../..

Build the i18n files for the server.

(venv) $ ./scripts/manageIl8n.sh

Create wheel

To build the wheel, only run this command:

(venv) $ npm run wheel

Here are the two steps followed by the previous command. It builds the client. The client built code is placed inside guirecognizerapp folder to be bundled in the python wheel.

$ cd client
client$ npm run build

It creates the folder guirecognizerapp/generated/client. Then it builds the wheel like any Python code.

(venv) $ python -m build

To launch the server once the wheel is installed:

(venv) $ python -m guirecognizerapp

OCR

Two optical character recognition libraries are supported: EasyOCR and tesseract.

Install EasyOCR (already in the dev dependencies).

(venv) $ python install easyocr

Install pytesseract (already in the dev dependencies).

(venv) $ python install easyocr

Install tesseract: follow installation instruction in https://github.com/tesseract-ocr/tesseract.

Client tests

Unit tests with vitest

$ npm run vitest

E2e test with playwright

(venv) $ npm run e2e

For playwright ui mode.

(venv) $ npx playwright test --ui

When building a test with Playwright Pick locator go to http://localhost:5201.

Coverage

Client coverage

(venv) $ npm run clientCoverage

Then open clientCoverage/index.html

Backend coverage

(venv) $ coverage run
(venv) $ coverage html

Then open htmlcov/index.html

Coding style

Some visual studio code settings of visualStudioCodeSettings.json should be used to ensure some homogeneity in the coding style.

In Visual Studio Code, install extensions

  • Svelte for client code

  • ESLint for typescript linting

  • Sherlock for client i18n helper

  • Playwright Test for client e2e tests

  • Vitest for client unit tests

  • isort to sort python automatically

  • Pylance for type checking

Miscellaneous

Some commands for a rough idea of number of lines of code (not a relevant metric but for curiosity).

$ find client/src/ -type d -name components -prune -o -name "*.svelte" -o -name "*.ts" | xargs wc -l | sort -nr
$ find guirecognizerapp -name "*.py" | xargs wc -l | sort -nr
$ find tests -name "*.py" | xargs wc -l | sort -nr
$ find e2e \( -name "*.ts" -o -name "*.py" -o -name "*.bat" -o -name "*.sh" \) | xargs wc -l | sort -nr

Improvements

Keyboard settings configuration: add a way to configure the shortcuts. Add them in the global config file. Add a reset button. The main motivation comes from the take screenshot shortcut because this shortcut needs to be global and not isolated to the web page.

e2e from building wheel: create another e2e setup that builds the wheel, creates a venv, launches the app then tests a very simple scenario.

Fix coverage for ProcessManager class: the coverage for this python class doesn’t properly work despite being tested.

Improve logger usage: in python backend and in tests.

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

guirecognizerapp-0.1.1.tar.gz (266.7 kB view details)

Uploaded Source

Built Distribution

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

guirecognizerapp-0.1.1-py3-none-any.whl (257.7 kB view details)

Uploaded Python 3

File details

Details for the file guirecognizerapp-0.1.1.tar.gz.

File metadata

  • Download URL: guirecognizerapp-0.1.1.tar.gz
  • Upload date:
  • Size: 266.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for guirecognizerapp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 54348d24cfe885fb710dc1b62cd2bb91fd3bccf5401a51428a270b0117bcdd26
MD5 8ba562271584fc9010754aeaef68b758
BLAKE2b-256 67bf0e26674ecebddd8d75bd3f400ea29d778439683872f9d7b10e6c763a7cf0

See more details on using hashes here.

File details

Details for the file guirecognizerapp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for guirecognizerapp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46dc80643d1aaef2c48084dcf7c27c9298a7933aee071ba7a17734c47f8b56b6
MD5 57cd8ee80b36fd8a356e166e13bec82a
BLAKE2b-256 8ec55c5bdfc802c9e7b1c88756509a12f08740655a0120b46a2b8b5808cb22ab

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