import pytesseract from PIL import Image
image = Image.open(file_path)
extracted_text = pytesseract.image_to_string(image)
extracted_text[:500]