Skip to main content

Detect unwanted characters in images inside the Open Telekom Cloud helpcenter

Project description

HCDC - Helpcenter Character Detection Client

HCDC is a client to detect certain characters inside newly changed files from a PR or a different Git branch. It will analyze text files and use an OCR service to recognize characters inside new or changed images.

Installation

pip install .

Usage

hcdc --help

Options

  -h, --help            Show this help message and exit.
  --debug               Option enables debug output.
  --processes <processes>
                        Number of processes for minification. Default: 4
  --repo-path <repo-path>
                        Path to the Git repository. Default: .
  --image-file-extensions <file-extensions> [<file-extensions> ...]
                        Image file extensions to be checked. Default: .jpg .png .jpeg .gif .webp .avif
  --text-file-extensions <file-extensions> [<file-extensions> ...]
                        Text file extensions to be checked. Default: .txt .md .rst .ini .cfg .json .xml .yml .yaml .py
  --branch <branch>     Branch to compare against the main branch. Default: main
  --main-branch <main-branch>
                        Name of the main branch. Default: main
  --ocr-url <ocr-url>   URL for the OCR Service. Default: https://ocr.eu-de.otc.t-systems.com/v2/project-id/ocr/general-text
  --regex-pattern <regex-pattern> [<regex-pattern> ...]
                        Regex pattern to check for unwanted characters. Default: (?![\u4e09\u767d\u76ee\u4e09\u8279\u53e3\u533a\u4e2a\u516b\u4e00\u4eba])[\u4e01-\u9fff]+
  --confidence <confidence>
                        Confidence threshold for image recognition. Default: 0.97

Custom Regex Pattern

You can use a custom regex pattern to check for unwanted characters in the files. The default pattern excludes some Chinese characters that may cause false positives in OCR results while checking for all other Chinese characters.

Authentication

To use this tool, ensure that you specify an AUTH_TOKEN to access the OCR service. For details on obtaining a token, refer to the official T-Systems Documentation.

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

hcdc-0.2.1.tar.gz (16.1 MB view details)

Uploaded Source

Built Distribution

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

hcdc-0.2.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file hcdc-0.2.1.tar.gz.

File metadata

  • Download URL: hcdc-0.2.1.tar.gz
  • Upload date:
  • Size: 16.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for hcdc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cfce159c682319cc652dbe1c1cf7bfd51e149e65f4964e9dce133b066249d9cf
MD5 6d37cbd7c35515e8e5119b8d2bb812de
BLAKE2b-256 83de926dd71e2b077b787f064872c9c01e1e7297503d8c518820e8939fe3f762

See more details on using hashes here.

File details

Details for the file hcdc-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: hcdc-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for hcdc-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17ef26c0db016fabffa6fcc64ce8851f2ddf453189033f31a471b4598a5de2f0
MD5 5f91fdeac3d6016a1fc48622ac6fae4d
BLAKE2b-256 7ec0b8fc19928354a6fddaa685ad27e13fddc461682e05e21663c92cc183eb7e

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