AlgoDocs API Python Client
This client API provides all required Python bindings for communicating with AlgoDocs REST API.
Documentation
Please visit AlgoDocs API Documentation for a detailed documentation of all API methods with their parameters and expected responses.
Installation
Using pip:
Note: algodocs python client was only tested with Python 3.
pip install algodocs
OR
Clone 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-python
cd algodocs-python
python setup.py install
For development:
pip install -r requirements.txt
Usage
To use AlgoDocs Python Client, you need to register at AlgoDocs and get your API Key from here
import algodocs
email_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 address
Get 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:
with open(file_path, "rb") as file_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 optional
limit = 10
date = (datetime.now() + timedelta(days=-10)).isoformat() # i.e. get extracted data from documents that were uploaded during last 10 days
result=client.getExtractedDataByExtractorID(extractor_id, folder_id, limit, date)
print(result)
Contributing
Bug reports and pull requests are welcome on GitHub.
License
The library is available as open source under the terms of the MIT License.
MIT License
Copyright (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.
Metadata
Release files for algodocs 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| algodocs-1.0.tar.gz | 4.2 kB | Without provenance | Details for algodocs-1.0.tar.gz |
Release files / algodocs-1.0.tar.gz
| Download URL | algodocs-1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
364659792d1a9968592dbcd1b62fd4c462760635b9e0a310fcb9cb7283f1012f
|
|
BLAKE2b-256 checksum How to use checksums |
b23ad278ae5363f007542f039e51e2ed28ba2119c88657dcbeadd9dceb3fe940
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Security for algodocs 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.