# -*- coding:utf-8 -*-

from aip import AipOcr

from setting.setting import OCR_CONFIG


class OCRUtils:
    def __init__(self):
        self.client = AipOcr(OCR_CONFIG['APP_ID'], OCR_CONFIG['API_KEY'], OCR_CONFIG['SECRET_KEY'])

    def ocr(self, image: bytes, options=None):
        return self.client.basicGeneral(image, options)

    @staticmethod
    def get_file_content(file_path):
        with open(file_path, 'rb') as fp:
            return fp.read()

    @staticmethod
    def save_res(file, file_path):
        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(file)

4dc50d843872512d48f51dae464ab3961abf908a
<mask token>


class OCRUtils:
    <mask token>

    def ocr(self, image: bytes, options=None):
        return self.client.basicGeneral(image, options)

    @staticmethod
    def get_file_content(file_path):
        with open(file_path, 'rb') as fp:
            return fp.read()
    <mask token>

<mask token>


class OCRUtils:

    def __init__(self):
        self.client = AipOcr(OCR_CONFIG['APP_ID'], OCR_CONFIG['API_KEY'],
            OCR_CONFIG['SECRET_KEY'])

    def ocr(self, image: bytes, options=None):
        return self.client.basicGeneral(image, options)

    @staticmethod
    def get_file_content(file_path):
        with open(file_path, 'rb') as fp:
            return fp.read()
    <mask token>

<mask token>


class OCRUtils:

    def __init__(self):
        self.client = AipOcr(OCR_CONFIG['APP_ID'], OCR_CONFIG['API_KEY'],
            OCR_CONFIG['SECRET_KEY'])

    def ocr(self, image: bytes, options=None):
        return self.client.basicGeneral(image, options)

    @staticmethod
    def get_file_content(file_path):
        with open(file_path, 'rb') as fp:
            return fp.read()

    @staticmethod
    def save_res(file, file_path):
        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(file)

from aip import AipOcr
from setting.setting import OCR_CONFIG


class OCRUtils:

    def __init__(self):
        self.client = AipOcr(OCR_CONFIG['APP_ID'], OCR_CONFIG['API_KEY'],
            OCR_CONFIG['SECRET_KEY'])

    def ocr(self, image: bytes, options=None):
        return self.client.basicGeneral(image, options)

    @staticmethod
    def get_file_content(file_path):
        with open(file_path, 'rb') as fp:
            return fp.read()

    @staticmethod
    def save_res(file, file_path):
        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(file)

# -*- coding:utf-8 -*-

from aip import AipOcr

from setting.setting import OCR_CONFIG


class OCRUtils:
    def __init__(self):
        self.client = AipOcr(OCR_CONFIG['APP_ID'], OCR_CONFIG['API_KEY'], OCR_CONFIG['SECRET_KEY'])

    def ocr(self, image: bytes, options=None):
        return self.client.basicGeneral(image, options)

    @staticmethod
    def get_file_content(file_path):
        with open(file_path, 'rb') as fp:
            return fp.read()

    @staticmethod
    def save_res(file, file_path):
        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(file)
