用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill python-docx-batch-document-generation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
Write outbound email and external messages in Vamsee Achanta's voice — a subtle offer to help, never bold or rash claims. Load before drafting ANY email, LinkedIn/Collide reply, proposal note, or outreach sent under his name.
Save/publish analysis or computation results from ANY ecosystem repo to Hugging Face as a queryable, viewer-renderable dataset. Use when the user wants to "save results to hugging face", "publish dataset to HF", "hugging face data saving", "save analysis results", "hf dataset", "make results queryable", or "render via datasets-server API". Reshapes nested results into flat parquet tables, writes a dataset card with a viewer `configs:` block and provenance, applies license/public-vs-private routing, enforces a domain data-quality gate (faithful-to-source != correct), publishes to `aceengineer/<repo>-<projection>`, and verifies via the datasets-server API.
Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.
| name | python-docx-batch-document-generation |
| description | Sub-skill of python-docx: Batch Document Generation. |
| version | 1.0.0 |
| category | data |
| type | reference |
| scripts_exempt | true |
"""
Generate multiple documents from a data source.
"""
from docx import Document
from docx.shared import Pt, Inches
from typing import List, Dict, Any
from pathlib import Path
import csv
from concurrent.futures import ThreadPoolExecutor, as_completed
def generate_single_document(
template_path: str,
output_dir: Path,
data: Dict[str, Any],
filename_field: str = 'id'
) -> str:
"""Generate a single document from template."""
doc = Document(template_path)
# Replace placeholders
for para in doc.paragraphs:
for key, value in data.items():
placeholder = f'{{{{{key}}}}}'
if placeholder in para.text:
for run in para.runs:
if placeholder in run.text:
run.text = run.text.replace(placeholder, str(value))
# Generate filename
filename = f"{data.get(filename_field, 'document')}.docx"
output_path = output_dir / filename
doc.save(str(output_path))
return str(output_path)
def batch_generate_documents(
template_path: str,
csv_data_path: str,
output_dir: str,
max_workers: int = 4
) -> List[str]:
"""Generate multiple documents from CSV data."""
output_path = Path(output_dir)
output_path.mkdir(parents=True, exist_ok=True)
# Read CSV data
with open(csv_data_path, 'r') as f:
reader = csv.DictReader(f)
records = list(reader)
generated_files = []
# Generate documents in parallel
with ThreadPoolExecutor(max_workers=max_workers) as executor:
futures = {
executor.submit(
generate_single_document,
template_path,
output_path,
record
): record
for record in records
}
for future in as_completed(futures):
try:
result = future.result()
generated_files.append(result)
print(f"Generated: {result}")
except Exception as e:
print(f"Error generating document: {e}")
return generated_files
# Usage
# batch_generate_documents(
# 'invoice_template.docx',
# 'clients.csv',
# 'generated_invoices/'
# )