Package: aspose-ocr-cloud
Aspose.OCR Cloud for Python SDK 23.12.0Aspose.OCR Cloudis an optical character recognition as a service. With it, you can easily add OCR functionality to almost any device or platform, including netbooks, mini PCs, or even entry-level smartphones.Our engine can read text from images, photos, screenshots and scanned PDFs in a wide variety of European, Cyrillic and Oriental fonts, returning results in the most popular document formats. Powerful built-in image processing filters based on neural networks automatically correct skewed and distorted images, automatically remove dirt, smudges, scratches, glare and other image defects that can affect recognition accuracy. To further improve the results, Aspose.OCR Cloud has a built-in spell checker that automatically replaces misspelled words and saves you the trouble of manually correcting the recognition results.Even the complex recognition tasks can be done with a couple of API calls. To make interacting with Aspose.OCR Cloud services from Python applications even easier, we provide the software development kit (SDK) for Python. It handles all the routine operations such as establishing connections, sending API requests, and parsing responses, wrapping all these tasks into a few simple classes.Aspose.OCR Cloud SDK for Python is open source under the MIT license. You can freely use it for any projects, including commercial and proprietary applications, as well as modify any part of its code.Try OnlineImage to TextImage to Searchable PDFPDF OCRReceipt ScannerWhat was changed in version 23.12.0A summary of recent changes, enhancements and bug fixes inAspose.OCR Cloud SDK for Python 23.12.0release:KeySummaryCategoryOCR‑3737Added a free API for evaluating image recognition withoutauthorization.Some restrictions apply. See below for details.New featurePublic API changes and backwards compatibilityThis section lists all public API changes introduced inAspose.OCR Cloud SDK for Python 23.12.0that may affect the code of existing applications.Added public APIs:The following public APIs have been introduced in this release:Image recognition evaluationThe following new classes have been added:ClassDescriptionRecognizeImageTrialApiImage recognition API that works without authorization.Important:In recognition results, 10% of the words are substituted with asterisks (*). The sequence of masked words remains unchanged upon re-submitting the identical image for recognition.Learn more...Updated public APIs:No changesRemoved public APIs:No changes.QuickstartMake your solution usingSDK, follow these steps:1. Get API keys if you haven'tMake a personal account onAspose Cloud Dashboardand clickGet Keys. These keys are useful for all Aspose Cloud products. If you have any trouble, look at thisdetailed manual.2. Run DemoCheckout the SDK or get frompip(pip install aspose-ocr-cloud)Set Your AppSid & AppKeyRun Python consoleDemoOCR in Python# Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).withaspose_ocr_cloud.ApiClient(config)asapi_client:# Create an instance of the API classapi_instance=recognize_image_api.RecognizeImageApi(api_client)# Read image file and conver it into base64 stringimage_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),'../samples/latin.png')# Create request bodybody=OCRRecognizeImageBody(image=utils.file_to_base64(image_file_path),settings=OCRSettingsRecognizeImage(language=Language("English"),makeSkewCorrect=False,makeBinarization=False,makeSpellCheck=False,makeContrastCorrection=False,makeUpsampling=False,dsrMode=DsrMode("NoDsrNoFilter"),dsrConfidence=DsrConfidence("Default"),resultType=ResultType("Text")),)try:# Step 1: perform post requesttask_id_response=api_instance.post_recognize_image(body=body,)task_id=task_id_response.bodyprint(f'Your task ID is{task_id}')# Step 2: perform get result requesttask_response:OCRResponse=api_instance.get_recognize_image(query_params={'id':task_id})asserttask_response.response.status==200asserttask_response.body['taskStatus']=='Completed'recognized_text_raw=task_response.body['results'][0]['data']recognized_text=bytearray(base64.b64decode(str(recognized_text_raw))).decode('utf-8')print(f'Recognized text:{recognized_text}')print(f'Task completed.Press Enter to continue')input()exceptaspose_ocr_cloud.ApiExceptionase:print("Exception when calling RecognizeImageApi:%s"% e)StructureThis project includes:Python console demo application - "./example"Module "asposeocrcloud" - this is SDK located in "./asposeocrcloud". You can integrate it in your application.Module "test" - "./test" UnitTest. You can take a look at them to see various code examples.Folder "docs" - "./docs" Full documentation for Aspose.OCR SDK in HTML format.DependenciesSee requirements.txtAspose.OCR Cloud SDKs.NET & CoreJavaPythonNode.jsAndroidProduct Page|Documentation|API Reference|Code Samples|Blog|Free Support|Free Trial