pdf-report-generator
БесплатноБез исполняемых скриптовНе проверенAutomatically generate PDF reports from construction data. Create formatted project reports with charts and tables.
от datadrivenconstruction★ 461 звезда на GitHubОб этом скилле
PDF Report Generator
Business Case
Problem Statement
Report generation challenges:
- Manual report creation is time-consuming
- Inconsistent formatting
- Data aggregation from multiple sources
- Repetitive weekly/monthly reports
Solution
Automated PDF report generation from project data with templates, charts, and customizable sections.
Technical Implementation
import pandas as pd
from typing import Dict, Any, List, Optional
from dataclasses import dataclass, field
from datetime import date, datetime
from enum import Enum
from io import BytesIO
class ReportType(Enum):
PROGRESS = "progress"
COST = "cost"
SAFETY = "safety"
QUALITY = "quality"
EXECUTIVE = "executive"
WEEKLY = "weekly"
MONTHLY = "monthly"
class SectionType(Enum):
HEADER = "header"
TEXT = "text"
TABLE = "table"
CHART = "chart"
KPI_CARDS = "kpi_cards"
IMAGE = "image"
PAGE_BREAK = "page_break"
@dataclass
class ReportSection:
section_type: SectionType
title: str = ""
content: Any = None
style: Dict[str, Any] = field(default_factory=dict)
@dataclass
class KPICard:
name: str
value: Any
unit: str = ""
target: Any = None
status: str = "normal" # normal, warning, critical, good
@dataclass
class ChartConfig:
chart_type: str # bar, line, pie
data: Dict[str, List]
title: str = ""
x_label: str = ""
y_label: str = ""
class PDFReportGenerator:
"""Generate PDF reports from construction project data."""
def __init__(self, project_name: str, report_type: ReportType):
self.project_name = project_name
self.report_type = report_type
self.sections: List[ReportSection] = []
self.metadata: Dict[str, Any] = {
'author': '',
'date': date.today(),
'version': '1.0'
}
def set_metadata(self, author: str = "", report_date: date = None, version: str = "1.0"):
"""Set report metadata."""
self.metadata['author'] = author
self.metadata['date'] = report_date or date.today()
self.metadata['version'] = version
def add_header(self, title: str, subtitle: str = ""):
"""Add report header section."""
self.sections.append(ReportSection(
section_type=SectionType.HEADER,
title=title,
content={'subtitle': subtitle, 'date': self.metadata['date'].isoformat()}
))
def add_text(self, title: str, content: str):
"""Add text section."""
self.sections.append(ReportSection(
section_type=SectionType.TEXT,
title=title,
content=content
))
def add_table(self, title: str, df: pd.DataFrame, style: Dict[str, Any] = None):
"""Add table section from DataFrame."""
self.sections.append(ReportSection(
section_type=SectionType.TABLE,
title=title,
content=df.to_dict('records'),
style=style or {}
))
def add_kpi_cards(self, title: str, kpis: List[KPICard]):
"""Add KPI cards section."""
self.sections.append(ReportSection(
section_type=SectionType.KPI_CARDS,
title=title,
content=[{
'name': k.name,
'value': k.value,
'unit': k.unit,
'target': k.target,
'status': k.status
} for k in kpis]
))
def add_chart(self, title: str, chart_config: ChartConfig):
"""Add chart section."""
self.sections.append(ReportSection(
section_type=SectionType.CHART,
title=title,
content={
'type': chart_config.chart_type,
'data': chart_config.data,
'x_label': chart_config.x_label,
'y_label': chart_config.y_label
}
))
def add_page_break(self):
"""Add page break."""
self.sections.append(ReportSection(section_type=SectionType.PAGE_BREAK))
def generate_progress_report(self, data: Dict[str, Any]):
"""Generate standard progress report."""
self.add_header(
f"{self.project_name} - Progress Report",
f"Report Date: {self.metadata['date']}"
)
# KPIs
kpis = [
KPICard("Overall Progress", f"{data.get('overall_progress', 0)}%", target="100%",
status="good" if data.get('overall_progress', 0) >= data.get('planned_progress', 0) else "warning"),
KPICard("SPI", f"{data.get('spi', 1.0):.2f}", target="1.00",
status="good" if data.get('spi', 1) >= 0.95 else "critical"),
KPICard("CPI", f"{data.get('cpi', 1.0):.2f}", target="1.00",
status="good" if data.get('cpi', 1) >= 0.95 else "critical"),
KPICard("Days Remaining", str(data.get('days_remaining', 0)), "days")
]
self.add_kpi_cards("Key Performa
Установить pdf-report-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pdf-report-generator?
Automatically generate PDF reports from construction data. Create formatted project reports with charts and tables.
Как установить скилл pdf-report-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pdf-report-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic