>>> results = parser.get_results(operations)
>>> docs = parser.parse_from_results(results)
docai_parse(blobs: Sequence[Blob], *, gcs_output_path: Optional[str] = None, processor_name: Optional[str] = None, batch_size: int = 1000, enable_native_pdf_parsing: bool = True, field_mask: Optional[str] = None) → List[Operation][source]¶
Runs Google Document AI PDF Batch Processing on a list of blobs.
Parameters
blobs – a list of blobs to be parsed
gcs_output_path – a path (folder) on GCS to store results
processor_name – name of a Document AI processor.
batch_size – amount of documents per batch
enable_native_pdf_parsing – a config option for the parser
field_mask – a comma-separated list of which fields to include in the
Document AI response.
suggested: “text,pages.pageNumber,pages.layout”
Document AI has a 1000 file limit per batch, so batches larger than that need
to be split into multiple requests.
Batch processing is an async long-running operation
and results are stored in a output GCS bucket.
get_results(operations: List[Operation]) → List[DocAIParsingResults][source]¶
is_running(operations: List[Operation]) → bool[source]¶
lazy_parse(blob: Blob) → Iterator[Document][source]¶
Parses a blob lazily.
Parameters
blobs – a Blob to parse
This is a long-running operation. A recommended way is to batchdocuments together and use the batch_parse() method.
online_process(blob: Blob, enable_native_pdf_parsing: bool = True, field_mask: Optional[str] = None, page_range: Optional[List[int]] = None) → Iterator[Document][source]¶
Parses a blob lazily using online processing.
Parameters