Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 979 Bytes

File metadata and controls

51 lines (36 loc) · 979 Bytes

Python Client

A simple urllib3 client is available at examples/python_client.py.

Install the Python dependency:

python3 -m pip install urllib3

Submit an image or PDF upload and wait for the final result:

python3 examples/python_client.py upload /path/to/input.pdf

If API key authentication is enabled:

python3 examples/python_client.py \
  --api-key replace-with-a-long-random-secret \
  upload /path/to/input.pdf

Submit a server-side image or PDF path:

python3 examples/python_client.py path /path/to/input.pdf

Use another OCR prompt:

python3 examples/python_client.py \
  --prompt '<image>read this receipt' \
  upload /path/to/image.png

Send the final job result to a webhook:

python3 examples/python_client.py \
  --webhook-url https://example.com/unlimited-ocr-webhook \
  upload /path/to/image.png

Fetch an existing job:

python3 examples/python_client.py job <job-id>