Home / Class/ BaseBlobParser Class — langchain Architecture

BaseBlobParser Class — langchain Architecture

Architecture documentation for the BaseBlobParser class in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c2330a24_e3e4_e78c_4dd3_e48e55c5acb8["BaseBlobParser"]
  8a32db24_cd7f_792c_4656_079ff226de4f["base.py"]
  c2330a24_e3e4_e78c_4dd3_e48e55c5acb8 -->|defined in| 8a32db24_cd7f_792c_4656_079ff226de4f
  18944d1a_b63d_cb04_45cb_1860cb91c4d4["lazy_parse()"]
  c2330a24_e3e4_e78c_4dd3_e48e55c5acb8 -->|method| 18944d1a_b63d_cb04_45cb_1860cb91c4d4
  9af986fe_72ff_59a9_178d_8a89c73a65d6["parse()"]
  c2330a24_e3e4_e78c_4dd3_e48e55c5acb8 -->|method| 9af986fe_72ff_59a9_178d_8a89c73a65d6

Relationship Graph

Source Code

libs/core/langchain_core/document_loaders/base.py lines 117–155

class BaseBlobParser(ABC):
    """Abstract interface for blob parsers.

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

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

    @abstractmethod
    def lazy_parse(self, blob: Blob) -> Iterator[Document]:
        """Lazy parsing interface.

        Subclasses are required to implement this method.

        Args:
            blob: `Blob` instance

        Returns:
            Generator of `Document` objects
        """

    def parse(self, blob: Blob) -> list[Document]:
        """Eagerly parse the blob into a `Document` or list of `Document` objects.

        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.

        Args:
            blob: `Blob` instance

        Returns:
            List of `Document` objects
        """
        return list(self.lazy_parse(blob))

Frequently Asked Questions

What is the BaseBlobParser class?
BaseBlobParser is a class in the langchain codebase, defined in libs/core/langchain_core/document_loaders/base.py.
Where is BaseBlobParser defined?
BaseBlobParser is defined in libs/core/langchain_core/document_loaders/base.py at line 117.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free