Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
617 B
4
Indexable
Never
import requests

api_key ="12306f71ce2f46b88957"
def ocr_space_file(filename, overlay=False, api_key=api_key, language='eng'):
    

    payload = {'isOverlayRequired': overlay,
               'apikey': api_key,
               'language': language,
               }
    with open(filename, 'rb') as f:
        r = requests.post('https://api.ocr.space/parse/image',
                          files={filename: f},
                          data=payload,
                          )
    return r.content.decode()



test_file = ocr_space_file(filename='111.PNG', language='chs')

print(test_file);