首页/数据分析/batch-processor
B

batch-processor

by @claude-office-skillsv1.0.0
3.9(9)

高效批量处理数百个文档,支持格式转换、数据提取和分析,提供并行执行和进度跟踪

batch-processingdocument-conversionautomationdata-extractionproductivityGitHub
安装方式
npx skills add claude-office-skills/skills --skill batch-processor
compare_arrows

Before / After 效果对比

1
使用前

逐个打开文件、手动转换格式、复制数据、记录结果,处理500个文档需要2-3天

使用后

并行批量处理文档、自动转换提取、实时进度跟踪,4小时完成500个文档处理

description SKILL.md

batch-processor

Batch Processor Skill

Overview

This skill enables efficient bulk processing of documents - convert, transform, extract, or analyze hundreds of files with parallel execution and progress tracking.

How to Use

  • Describe what you want to accomplish

  • Provide any required input data or files

  • I'll execute the appropriate operations

Example prompts:

  • "Convert 100 PDFs to Word documents"

  • "Extract text from all images in a folder"

  • "Batch rename and organize files"

  • "Mass update document headers/footers"

Domain Knowledge

Batch Processing Patterns

Input: [file1, file2, ..., fileN]
         │
         ▼
    ┌─────────────┐
    │  Parallel   │  ← Process multiple files concurrently
    │  Workers    │
    └─────────────┘
         │
         ▼
Output: [result1, result2, ..., resultN]

Python Implementation

from concurrent.futures import ProcessPoolExecutor, as_completed
from pathlib import Path
from tqdm import tqdm

def process_file(file_path: Path) -> dict:
    """Process a single file."""
    # Your processing logic here
    return {"path": str(file_path), "status": "success"}

def batch_process(input_dir: str, pattern: str = "*.*", max_workers: int = 4):
    """Process all matching files in directory."""
    
    files = list(Path(input_dir).glob(pattern))
    results = []
    
    with ProcessPoolExecutor(max_workers=max_workers) as executor:
        futures = {executor.submit(process_file, f): f for f in files}
        
        for future in tqdm(as_completed(futures), total=len(files)):
            file = futures[future]
            try:
                result = future.result()
                results.append(result)
            except Exception as e:
                results.append({"path": str(file), "error": str(e)})
    
    return results

# Usage
results = batch_process("/documents/invoices", "*.pdf", max_workers=8)
print(f"Processed {len(results)} files")

Error Handling & Resume

import json
from pathlib import Path

class BatchProcessor:
    def __init__(self, checkpoint_file: str = "checkpoint.json"):
        self.checkpoint_file = checkpoint_file
        self.processed = self._load_checkpoint()
    
    def _load_checkpoint(self):
        if Path(self.checkpoint_file).exists():
            return json.load(open(self.checkpoint_file))
        return {}
    
    def _save_checkpoint(self):
        json.dump(self.processed, open(self.checkpoint_file, "w"))
    
    def process(self, files: list, processor_func):
        for file in files:
            if str(file) in self.processed:
                continue  # Skip already processed
            
            try:
                result = processor_func(file)
                self.processed[str(file)] = {"status": "success", **result}
            except Exception as e:
                self.processed[str(file)] = {"status": "error", "error": str(e)}
            
            self._save_checkpoint()  # Resume-safe

Best Practices

  • Use progress bars (tqdm) for user feedback

  • Implement checkpointing for long jobs

  • Set reasonable worker counts (CPU cores)

  • Log failures for later review

Installation

# Install required dependencies
pip install python-docx openpyxl python-pptx reportlab jinja2

Resources

Weekly Installs215Repositoryclaude-office-s…s/skillsGitHub Stars19First Seen11 days agoSecurity AuditsGen Agent Trust HubPassSocketPassSnykPassInstalled onclaude-code170opencode93github-copilot92gemini-cli90codex90amp90

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量631
评分3.9 / 5.0
版本1.0.0
更新日期2026年3月21日
对比案例1 组

用户评分

3.9(9)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月21日
最后更新2026年3月21日