code: def read_char(image, whitelist=None):
      
      from tesserocr import PyTessBaseAPI
      api = PyTessBaseAPI()
      api.SetPageSegMode(10)
      if whitelist is not None:
          api.SetVariable("tessedit_char_whitelist", whitelist)
      api.SetImage(image)
      api.Recognize()
      return api.GetUTF8Text().strip()
docs: OCR a single character from an image. Useful for captchas.