← Back to all products
$39
Product Catalog Manager
Bulk product import/export, category management, variant handling, SEO metadata generation, and image optimization scripts.
JSONMarkdownYAMLPython
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 22 files
product-catalog-manager/
├── LICENSE
├── README.md
├── configs/
│ └── catalog_config.yaml
├── data/
│ ├── sample_categories.json
│ └── sample_products.csv
├── free-sample.zip
├── guide/
│ ├── 01-overview.md
│ ├── 02-bulk-product-import-and-export.md
│ └── 03-seo-metadata-generation.md
├── guides/
│ └── catalog_guide.md
├── index.html
├── scripts/
│ └── run_catalog.py
├── src/
│ ├── __init__.py
│ ├── catalog.py
│ ├── categories.py
│ ├── images.py
│ ├── importer.py
│ ├── models.py
│ ├── seo.py
│ ├── validator.py
│ └── variants.py
└── tests/
└── test_catalog.py
📖 Documentation Preview README excerpt
Product Catalog Manager
Python toolkit for managing e-commerce product catalogs with bulk import/export, hierarchical categories, variant generation, SEO metadata, image optimization, and data validation.
What's Included
- Catalog Manager — Central CRUD coordinator with search, filtering, bulk operations, and JSON persistence
- Bulk Importer — Import products from CSV or JSON with flexible column mapping and error reporting
- Category Tree — Hierarchical category management with path computation, breadcrumbs, and tree traversal
- Variant Manager — Generate product variants from option axes (Size x Color → SKUs) with price modifiers
- SEO Generator — Auto-generate meta titles, descriptions, Open Graph tags, and JSON-LD structured data
- Image Optimizer — Analyze product images, generate resize commands, and enforce naming conventions
- Product Validator — Validate catalog data quality with configurable rules and aggregate reporting
Quick Start
python scripts/run_catalog.py
from src.catalog import CatalogManager
from src.models import CatalogProduct
from src.seo import SEOGenerator
from src.variants import VariantManager
catalog = CatalogManager()
seo_gen = SEOGenerator(store_name="My Shop", base_url="https://shop.example.com")
# Create a product with variants
product = CatalogProduct(sku="SKU-001", name="Classic T-Shirt", base_price=24.99, cost_price=8.50)
vm = VariantManager()
vm.add_axis("Size", ["S", "M", "L", "XL"])
vm.add_axis("Color", ["Black", "White"])
vm.apply_to_product(product) # Generates 8 variant SKUs
product.seo = seo_gen.generate(product)
catalog.add_product(product)
Contents
├── src/ — Core Python package (8 modules)
│ ├── models.py — CatalogProduct, Category, Variant, SEOMetadata
│ ├── catalog.py — CatalogManager with search, filter, bulk ops
│ ├── categories.py — CategoryTree with hierarchy and breadcrumbs
│ ├── seo.py — SEOGenerator and SEO auditing
│ ├── variants.py — VariantManager with cartesian product generation
│ ├── importer.py — BulkImporter/Exporter for CSV and JSON
│ ├── images.py — ImageOptimizer for analysis and batch commands
│ └── validator.py — ProductValidator with configurable rules
├── data/ — Sample CSV and JSON data files
├── configs/ — Annotated YAML configuration
├── scripts/ — Runnable demo script
├── tests/ — Unit tests (18+ test cases)
└── guides/ — Setup and usage guide
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
src/catalog.py
"""
Catalog Manager — Product Catalog Manager
==========================================
Central coordinator for all catalog operations: add, update, search,
filter, and delete products. Maintains an in-memory catalog with
optional JSON persistence.
"""
from __future__ import annotations
import json
import logging
from collections import defaultdict
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
from src.models import CatalogProduct, Category, Variant
logger = logging.getLogger(__name__)
# Type alias for product filter functions
ProductFilter = Callable[[CatalogProduct], bool]
class CatalogManager:
"""Manages the product catalog with search, filter, and persistence.
Usage:
catalog = CatalogManager()
catalog.add_product(product)
results = catalog.search("black t-shirt")
catalog.save("catalog.json")
"""
def __init__(self) -> None:
self._products: Dict[str, CatalogProduct] = {} # sku -> product
self._slug_index: Dict[str, str] = {} # slug -> sku (for URL lookups)
# ------------------------------------------------------------------
# CRUD operations
# ------------------------------------------------------------------
def add_product(self, product: CatalogProduct) -> None:
"""Add a product to the catalog. Raises if SKU already exists."""
if product.sku in self._products:
raise ValueError(f"Product with SKU {product.sku} already exists")
self._products[product.sku] = product
self._slug_index[product.slug] = product.sku
logger.info("Added product: %s (%s)", product.sku, product.name)
# ... 209 more lines ...