Skip to content

API Reference parrot.advisors.catalog.loaders

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

parrot.advisors.catalog.loaders

View source

Loaders for ingesting product data into ProductCatalog.

Supports:

  • JSON with embedded markdown
  • JSON + separate markdown files
  • Structured JSON only

Class CSVLoader

Loader for CSV product data.

Supports column mapping from CSV headers to ProductSpec fields. Automatically parses JSON columns (features, faqs, specs, product_variants, etc.).

Example CSV (new format): product_url,product_name,price,description,image_url,features,faqs,footprint_sqft, product_variants,specs,product_json,product_data,document

Parameter Type Default Description
catalog ProductCatalog ProductCatalog instance to load products into
column_mapping Dict[str, str] None Maps CSV columns to ProductSpec fields Use "specs.field" for nested specs fields
delimiter str ',' CSV delimiter (default: comma)
encoding str 'utf-8' File encoding (default: utf-8)
json_columns List[str] None List of column names that contain JSON data Defaults to common JSON columns if not specified
**kwargs {}

Method CSVLoader.load_file

Load products from a CSV file.

load_file(file_path: Union[str, Path]) -> LoadResult

Parameter Type Default Description
file_path Union[str, Path]

Returns: LoadResult

Alias FeatureType

Re-exported from parrot.advisors.models.FeatureType.

Class JSONMarkdownLoader

Loader for JSON files with embedded markdown descriptions.

Format:
{
    "products": [
        {
            "id": "shed-001",
            "name": "Classic Shed",
            "specs": {...},
            "description": "# Full Markdown Content

..." } ] }

Class LoadResult

Result of a load operation.

Parameter Type Default Description
loaded int
errors List[str]
product_ids List[str]

Fields:

Field Type Default Description
loaded int
errors List[str]
product_ids List[str]

Alias ProductDimensions

Re-exported from parrot.advisors.models.ProductDimensions.

Alias ProductFeature

Re-exported from parrot.advisors.models.ProductFeature.

Class ProductLoader

Base loader for product data.

Override _parse_product() for custom formats.

Parameter Type Default Description
catalog ProductCatalog
category_default str 'general'
auto_detect_features bool True

Method ProductLoader.load_file

Load products from a JSON file.

load_file(file_path: Union[str, Path]) -> LoadResult

Parameter Type Default Description
file_path Union[str, Path]

Returns: LoadResult

Method ProductLoader.load_products

Load multiple products from parsed data.

load_products(products_data: List[Dict[str, Any]]) -> LoadResult

Parameter Type Default Description
products_data List[Dict[str, Any]]

Returns: LoadResult

Alias ProductSpec

Re-exported from parrot.advisors.models.ProductSpec.

Class SeparateMarkdownLoader

Loader for JSON specs + separate markdown files.

Expects:

  • products.json with basic specs
  • products/{id}.md for each product's full description
Parameter Type Default Description
catalog ProductCatalog
markdown_dir Union[str, Path]
**kwargs {}

Method SeparateMarkdownLoader.load_file

Load products and their markdown descriptions.

load_file(file_path: Union[str, Path]) -> LoadResult

Parameter Type Default Description
file_path Union[str, Path]

Returns: LoadResult

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