Skip to content

API Reference parrot_loaders.basepdf

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_loaders.basepdf

View source

Class BasePDF

Base Abstract loader for all PDF-file Loaders.

Parameter Type Default Description
source Optional[Union[str, Path, List[Union[str, Path]]]] None
tokenizer Union[str, Callable] None
text_splitter Union[str, Callable] None
source_type str 'file'
as_markdown bool False
use_chapters bool False
use_pages bool False
**kwargs {}

Attributes:

Attribute Type Description
extensions set[str]

Method BasePDF.build_default_meta

Return canonical metadata for a PDF source.

A convenience wrapper around :meth:create_metadata that pre-sets doctype and source_type to the PDF defaults. Subclasses that override _load can call this instead of assembling raw dicts.

build_default_meta(path: Union[str, PurePath], *, language: Optional[str] = None, title: Optional[str] = None, **kwargs) -> dict

Parameter Type Default Description
path Union[str, PurePath] Filesystem path to the PDF file.
language Optional[str] None Document language ISO code. Falls back to self.language when not provided.
title Optional[str] None Human-readable title. Falls back to :meth:_derive_title when not provided.
**kwargs {} Loader-specific extras that become top-level metadata keys (e.g. page_index, section).

Returns: dict — A metadata dict with canonical top-level keys and a closed-shape document_meta sub-dict.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally