V1 Mindee HTTP
Base Endpoint
- class BaseEndpoint(settings, http_client=None)
Base endpoint class for the Mindee API.
- Parameters:
settings (BaseSettings)
http_client (Client | None)
- http_client: Client | None
HTTP client for making requests.
- settings: BaseSettings
Settings relating to all endpoints.
Base Settings
- class BaseSettings(api_key)
Settings class relating to API requests.
- Parameters:
api_key (str | None)
- set_base_url(value)
Set the base URL for all requests.
- Return type:
None- Parameters:
value (str)
- set_from_env()
Set various parameters from environment variables, if present.
- Return type:
None
- set_timeout(value)
Set the timeout for all requests.
- Return type:
None- Parameters:
value (str | int)
- api_key: str | None
API Key for the client.
- property base_headers: dict[str, str]
Base headers to send with all API requests.
- base_url: str
Base URL for all V2 requests.
- request_timeout: int
Timeout for all requests.
Endpoint
- class Endpoint(url_name, owner, version, settings, http_client=None)
Generic API endpoint for a product.
- Parameters:
url_name (str)
owner (str)
version (str)
settings (MindeeAPI)
http_client (Client | None)
- document_feedback_req_put(document_id, feedback)
Send a feedback.
- Parameters:
document_id (
str) – ID of the document to send feedback to.feedback (
dict[str,Any]) – Feedback object to send.
- Return type:
Response
- document_queue_req_get(queue_id)
Sends a request matching a given queue_id. Returns either a Job or a Document.
- Parameters:
queue_id (
str) – queue_id received from the API- Return type:
Response
- openapi_get_req()
Get the OpenAPI specification of the product.
- Return type:
Response
- predict_async_req_post(input_source, include_words=False, close_file=True, cropper=False, full_text=False, workflow_id=None, rag=False)
Make an asynchronous request to POST a document for prediction.
- Parameters:
input_source (
LocalInputSource|URLInputSource) – Input objectinclude_words (
bool, default:False) – Include raw OCR words in the responseclose_file (
bool, default:True) – Whether to close() the file after parsing it.cropper (
bool, default:False) – Including Mindee cropping results.full_text (
bool, default:False) – Whether to include the full OCR text response in compatibleworkflow_id (str | None)
rag (bool)
- Return type:
Response
APIs. :type workflow_id:
str|None, default:None:param workflow_id: Workflow ID. :type rag:bool, default:False:param rag: If set, will enable Retrieval-Augmented Generation.- Return type:
Response- Returns:
httpx response
- Parameters:
input_source (LocalInputSource | URLInputSource)
include_words (bool)
close_file (bool)
cropper (bool)
full_text (bool)
workflow_id (str | None)
rag (bool)
- predict_req_post(input_source, include_words=False, close_file=True, cropper=False, full_text=False)
Make a request to POST a document for prediction.
- Parameters:
input_source (
LocalInputSource|URLInputSource) – Input objectinclude_words (
bool, default:False) – Include raw OCR words in the responseclose_file (
bool, default:True) – Whether to close() the file after parsing it.cropper (
bool, default:False) – Including Mindee cropping results.full_text (
bool, default:False) – Whether to include the full OCR text response in compatible
- Return type:
Response
APIs.
- Return type:
Response- Returns:
httpx response
- Parameters:
input_source (LocalInputSource | URLInputSource)
include_words (bool)
close_file (bool)
cropper (bool)
full_text (bool)
- http_client: Client | None
HTTP client for making requests.
MindeeAPI
- class MindeeAPI(api_key, endpoint_name, account_name, version)
Settings class relating to API requests.
- Parameters:
api_key (str | None)
endpoint_name (str)
account_name (str)
version (str)
- set_base_url(value)
Set the base URL for all requests.
- Return type:
None- Parameters:
value (str)
- set_from_env()
Set various parameters from environment variables, if present.
- Return type:
None
- set_timeout(value)
Set the timeout for all requests.
- Return type:
None- Parameters:
value (str | int)
- api_key: str | None
API Key for the client.
- property base_headers: dict[str, str]
Base headers to send with all API requests.
- base_url: str
Base URL for all V2 requests.
- request_timeout: int
Timeout for all requests.
Workflow Endpoint
- class WorkflowEndpoint(settings, http_client=None)
Workflow endpoint.
- Parameters:
settings (WorkflowSettings)
http_client (Client | None)
- workflow_execution_post(input_source, options)
Sends the document to the workflow.
- Parameters:
input_source (
LocalInputSource|URLInputSource) – The document/source file to use. Has to be created beforehand.options (
WorkflowOptions) – Options for the workflow.
- Returns:
- http_client: Client | None
HTTP client for making requests.
- settings: WorkflowSettings
Settings object.
Workflow Settings
- class WorkflowSettings(api_key, workflow_id)
Settings class relating to workflow requests.
- Parameters:
api_key (str | None)
workflow_id (str)
- set_base_url(value)
Set the base URL for all requests.
- Return type:
None- Parameters:
value (str)
- set_from_env()
Set various parameters from environment variables, if present.
- Return type:
None
- set_timeout(value)
Set the timeout for all requests.
- Return type:
None- Parameters:
value (str | int)
- api_key: str | None
API Key for the client.
- property base_headers: dict[str, str]
Base headers to send with all API requests.
- base_url: str
Base URL for all V2 requests.
- request_timeout: int
Timeout for all requests.