Package: algodocs
AlgoDocs API Python ClientThis client API provides all required Python bindings for communicating withAlgoDocs REST API.DocumentationPlease visitAlgoDocs API Documentationfor a detailed documentation of all API methods with their parameters and expected responses.InstallationUsing pip:Note:algodocs python client was only tested with Python 3.pip install algodocsORClone current repository or download as zip file and unzip its contents, then change directory to the root folder and then install.git clone https://github.com/algodocs/algodocs-pythoncd algodocs-pythonpython setup.py installFor development:pip install -r requirements.txtUsageTo use AlgoDocs Python Client, you need to register atAlgoDocsand get your API Key fromhereimportalgodocsemail_address="your_email_addres_you_registered_with_at_AlgoDocs"key="your_secret_api_key"client=algodocs.AlgoDocsClient(email_address,key)Test connection and authenticate as follows:result=client.me()print(result)#this will print your name, surname and email addressGet all extractors in your AlgoDocs account:result=client.getExtractors()print(result)Get all folders in your AlgoDocs account:result=client.getFolders()print(result)Upload local file using its full path:file_path="full_path_to_your_file.pdf"#accepted file types: PDF, PNG, JPG/JPEG, WORD (.doc, .docx), EXCEL (.xls, .xlsx)extractor_id="your_extractor_id"#use extractor id that you got from client.getExtractors()folder_id="your_folder_id"#use folder id that you got from client.getFolders()result=client.uploadDocumentLocal(extractor_id,folder_id,file_path)print(result)Upload file in base64 format:withopen(file_path,"rb")asfile_contents:file_base64=base64.b64encode(file_contents.read())result=client.uploadDocumentBase64(extractor_id,folder_id,file_base64,os.path.basename(file_path))print(result)Upload file using its publicly accessible url:url="https://api.algodocs.com/content/SampleInvoice.pdf"result=client.uploadDocumentUrl(extractor_id,folder_id,url)print(result)Get extracted data of a single document using its id:document_id="your_document_id"#this document_id comes from result['id'] above, so use your actual document_id that you received in response dictionary object after importing the document to AlgoDocs...result=client.getExtractedDataByDocumentID(document_id)print(result)Get extracted data of multiple documents using extractor id:#`folder_id`, `limit` and `date` parameters are optionallimit=10date=(datetime.now()+timedelta(days=-10)).isoformat()# i.e. get extracted data from documents that were uploaded during last 10 daysresult=client.getExtractedDataByExtractorID(extractor_id,folder_id,limit,date)print(result)ContributingBug reports and pull requests are welcome onGitHub.LicenseThe library is available as open source under the terms of theMIT License.MIT LicenseCopyright (c) 2022 Algosoft Ltd.Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.