averbis / averbis-python-api

Conveniently access the REST API of Averbis products using Python
Apache License 2.0
12 stars 4 forks source link

Issue #156: Support analysing pdf #157

Closed UWinch closed 3 months ago

UWinch commented 4 months ago

What's in the PR?

Support the analyse pdf endpoint with two new methods analyse_pdf_to_pdf (returns bytes) and analyse_pdf_to_json (returns json).

How to test manually?

E.g send a pdf to be analysed and saved to an annotated pdf file with

client = Client(PRODUCT_URL, api_token=API_TOKEN)
project = client.get_project("Test")
pipeline = project.get_pipeline("pipeline")

with open(TARGET_FILE_PATH, 'wb') as target_file:
    target_file.write(pipeline.analyse_pdf_to_pdf(PDF_FILE_PATH))