BaseBlobParser#

class langchain_core.document_loaders.base.BaseBlobParser[source]#

Abstract interface for blob parsers.

A blob parser provides a way to parse raw data stored in a blob into one or more documents.

The parser can be composed with blob loaders, making it easy to reuse a parser independent of how the blob was originally loaded.

Methods

lazy_parse(blob)

Lazy parsing interface.

parse(blob)

Eagerly parse the blob into a document or documents.

abstract lazy_parse(blob: Blob) Iterator[Document][source]#

Lazy parsing interface.

Subclasses are required to implement this method.

Parameters:

blob (Blob) – Blob instance

Returns:

Generator of documents

Return type:

Iterator[Document]

parse(blob: Blob) list[Document][source]#

Eagerly parse the blob into a document or documents.

This is a convenience method for interactive development environment.

Production applications should favor the lazy_parse method instead.

Subclasses should generally not over-ride this parse method.

Parameters:

blob (Blob) – Blob instance

Returns:

List of documents

Return type:

list[Document]

Examples using BaseBlobParser