Token导航 LogoToken导航

Agent Skill · 前端设计

reportlab(reportlab 搜索)

reportlab 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

reportlab 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 6,431。

总安装 509周安装 21GitHub Stars 2下载 166核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:reportlab(reportlab 搜索)
来源仓库:https://github.com/silvainfm/claude-skills
仓库路径:skills/reportlab
安装命令:
npx skills add https://github.com/silvainfm/claude-skills --skill reportlab
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/silvainfm/claude-skills --skill reportlab

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

reportlab用于处理GitHub仓库、Issue、Pull Request和代码协作信息。它适合围绕仓库状态、代码变更或协作事项进行整理,提升开发流程透明度。可通过npx skills add命令从GitHub仓库安装,具体用法需结合原始README进一步确认。

安装前请核实权限范围、维护状态及是否涉及联网或文件操作。reportlab 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/reportlab

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/silvainfm/claude-skills --skill reportlab;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

reportlab 怎么安装?

在终端执行 npx skills add https://github.com/silvainfm/claude-skills --skill reportlab。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

reportlab 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

reportlab 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

reportlab 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

reportlab 用的人多吗?

公开数据是累计安装 509 次,近一周安装 21 次,下载 166 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

reportlab 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
reportlab

reportlab 搜索 · 本页

5092需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

ReportLab

Overview

ReportLab is a powerful open-source Python library for creating PDF documents programmatically. Generate professional PDFs with precise control over layout, typography, graphics, tables, and charts. Perfect for automated report generation, invoices, certificates, and custom documents.

When to Use This Skill

Activate when the user:

  • Wants to generate PDF documents programmatically
  • Needs to create invoices, reports, or receipts
  • Asks to create certificates, labels, or forms
  • Mentions ReportLab explicitly
  • Wants custom PDF layouts with tables, charts, or graphics
  • Needs to automate document generation
  • Wants precise control over PDF layout and styling

Installation

Check if ReportLab is installed:

python3 -c "import reportlab; print(reportlab.Version)"

If not installed:

pip3 install reportlab

For additional fonts and features:

pip3 install reportlab[renderPM,rlPyCairo]

Two Approaches: Canvas vs Platypus

ReportLab provides two APIs:

Canvas API (Low-Level)

  • Direct drawing on PDF pages
  • Precise positioning with x, y coordinates
  • Like painting on a canvas
  • Best for: Simple documents, custom layouts, graphics-heavy PDFs

Platypus API (High-Level)

  • Flowable document elements
  • Automatic layout and pagination
  • Easier for complex multi-page documents
  • Best for: Reports, articles, documents with lots of text

Canvas API (Low-Level Drawing)

Basic Canvas Usage

from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter, A4
from reportlab.lib.units import inch

# Create PDF
c = canvas.Canvas("output.pdf", pagesize=letter)
width, height = letter

# Draw text
c.drawString(100, height - 100, "Hello, World!")

# Set font
c.setFont("Helvetica-Bold", 24)
c.drawString(100, height - 150, "Large Bold Text")

# Save PDF
c.save()

Drawing Shapes and Lines

from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib import colors

c = canvas.Canvas("shapes.pdf", pagesize=letter)
width, height = letter

# Line
c.line(50, height - 50, width - 50, height - 50)

# Rectangle
c.rect(50, height - 200, 200, 100, stroke=1, fill=0)

# Filled rectangle with color
c.setFillColor(colors.lightblue)
c.setStrokeColor(colors.blue)
c.rect(300, height - 200, 200, 100, stroke=1, fill=1)

# Circle
c.circle(150, height - 350, 50, stroke=1, fill=0)

# Rounded rectangle
c.roundRect(300, height - 400, 200, 100, 10, stroke=1, fill=0)

c.save()

Working with Text

from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib import colors

c = canvas.Canvas("text.pdf", pagesize=letter)
width, height = letter

# Different fonts and sizes
c.setFont("Helvetica", 12)
c.drawString(50, height - 50, "Helvetica 12pt")

c.setFont("Helvetica-Bold", 16)
c.drawString(50, height - 80, "Helvetica Bold 16pt")

c.setFont("Times-Roman", 14)
c.drawString(50, height - 110, "Times Roman 14pt")

# Colored text
c.setFillColor(colors.red)
c.drawString(50, height - 140, "Red text")

c.setFillColor(colors.blue)
c.drawString(50, height - 170, "Blue text")

# Text alignment
text = "Right-aligned text"
text_width = c.stringWidth(text, "Helvetica", 12)
c.setFont("Helvetica", 12)
c.setFillColor(colors.black)
c.drawString(width - text_width - 50, height - 200, text)

# Multi-line text with textobject
textobject = c.beginText(50, height - 250)
textobject.setFont("Helvetica", 12)
textobject.textLines("""This is multi-line text.
Each line will be rendered separately.
Great for paragraphs!""")
c.drawText(textobject)

c.save()

Adding Images

from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch

c = canvas.Canvas("images.pdf", pagesize=letter)
width, height = letter

# Draw image
c.drawImage("logo.png", 50, height - 200, width=2*inch, height=1*inch)

# Image with preserved aspect ratio
c.drawImage("photo.jpg", 50, height - 400, width=3*inch, preserveAspectRatio=True)

c.save()

Platypus API (High-Level Documents)

Basic Document Structure

from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.units import inch

# Create document
doc = SimpleDocTemplate("document.pdf", pagesize=letter)
story = []  # Container for flowable elements

# Get styles
styles = getSampleStyleSheet()

# Add content
story.append(Paragraph("Document Title", styles['Title']))
story.append(Spacer(1, 0.2*inch))
story.append(Paragraph("This is a paragraph of text.", styles['Normal']))
story.append(Paragraph("This is another paragraph.", styles['Normal']))

# Build PDF
doc.build(story)

Working with Paragraphs and Styles

from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY
from reportlab.lib.units import inch
from reportlab.lib import colors

doc = SimpleDocTemplate("styled_doc.pdf", pagesize=letter)
story = []
styles = getSampleStyleSheet()

# Built-in styles
story.append(Paragraph("Title Style", styles['Title']))
story.append(Paragraph("Heading 1", styles['Heading1']))
story.append(Paragraph("Heading 2", styles['Heading2']))
story.append(Paragraph("Normal paragraph text.", styles['Normal']))
story.append(Spacer(1, 0.2*inch))

# Custom style
custom_style = ParagraphStyle(
    'CustomStyle',
    parent=styles['Normal'],
    fontSize=14,
    textColor=colors.blue,
    alignment=TA_CENTER,
    spaceAfter=10,
)
story.append(Paragraph("Centered blue text", custom_style))

# Justified paragraph
justified_style = ParagraphStyle(
    'Justified',
    parent=styles['Normal'],
    alignment=TA_JUSTIFY,
)
long_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " * 10
story.append(Paragraph(long_text, justified_style))

doc.build(story)

Creating Tables

from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph
from reportlab.lib.pagesizes import letter
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet

doc = SimpleDocTemplate("table.pdf", pagesize=letter)
story = []
styles = getSampleStyleSheet()

story.append(Paragraph("Sales Report", styles['Title']))

# Table data
data = [
    ['Product', 'Q1', 'Q2', 'Q3', 'Q4'],
    ['Widget A', '$1,000', '$1,200', '$1,100', '$1,300'],
    ['Widget B', '$800', '$900', '$950', '$1,000'],
    ['Widget C', '$1,500', '$1,600', '$1,700', '$1,800'],
    ['Total', '$3,300', '$3,700', '$3,750', '$4,100'],
]

# Create table
table = Table(data)

# Style table
table.setStyle(TableStyle([
    # Header row
    ('BACKGROUND', (0, 0), (-1, 0), colors.grey),
    ('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
    ('ALIGN', (0, 0), (-1, 0), 'CENTER'),
    ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
    ('FONTSIZE', (0, 0), (-1, 0), 12),
    ('BOTTOMPADDING', (0, 0), (-1, 0), 12),

    # Data rows
    ('BACKGROUND', (0, 1), (-1, -2), colors.beige),
    ('ALIGN', (1, 1), (-1, -1), 'RIGHT'),
    ('FONTNAME', (0, 1), (-1, -1), 'Helvetica'),
    ('FONTSIZE', (0, 1), (-1, -1), 10),
    ('GRID', (0, 0), (-1, -1), 1, colors.black),

    # Total row
    ('BACKGROUND', (0, -1), (-1, -1), colors.lightgrey),
    ('FONTNAME', (0, -1), (-1, -1), 'Helvetica-Bold'),
]))

story.append(table)
doc.build(story)

Adding Charts

from reportlab.platypus import SimpleDocTemplate, Paragraph
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics.charts.piecharts import Pie
from reportlab.lib import colors

doc = SimpleDocTemplate("charts.pdf", pagesize=letter)
story = []
styles = getSampleStyleSheet()

story.append(Paragraph("Sales Charts", styles['Title']))

# Bar chart
drawing = Drawing(400, 200)
bar_chart = VerticalBarChart()
bar_chart.x = 50
bar_chart.y = 50
bar_chart.height = 125
bar_chart.width = 300
bar_chart.data = [[100, 150, 200, 175, 225]]
bar_chart.categoryAxis.categoryNames = ['Q1', 'Q2', 'Q3', 'Q4', 'Q5']
bar_chart.bars[0].fillColor = colors.blue
drawing.add(bar_chart)
story.append(drawing)

# Pie chart
drawing2 = Drawing(400, 200)
pie = Pie()
pie.x = 150
pie.y = 50
pie.width = 100
pie.height = 100
pie.data = [30, 25, 20, 15, 10]
pie.labels = ['Product A', 'Product B', 'Product C', 'Product D', 'Other']
pie.slices.strokeWidth = 0.5
drawing2.add(pie)
story.append(drawing2)

doc.build(story)

Common Patterns

See references/patterns.md for common patterns and uses.

Best Practices

  1. Choose the right API - Use Canvas for simple layouts, Platypus for complex documents
  2. Use constants for measurements - Use inch, cm from reportlab.lib.units
  3. Define styles once - Create custom styles and reuse them
  4. Test page sizes - Verify output on different page sizes (letter, A4, etc.)
  5. Handle images carefully - Check image paths exist before adding to PDF
  6. Use tables for layouts - Tables are great for structured layouts
  7. Cache fonts - Register custom fonts once at module level

Common Issues

Issue: Text going off page

Calculate available space before drawing:

from reportlab.lib.pagesizes import letter

width, height = letter
margin = 50  # pixels
usable_width = width - 2 * margin
usable_height = height - 2 * margin

Issue: Images not found

Use absolute paths or verify file existence:

import os

image_path = "logo.png"
if os.path.exists(image_path):
    c.drawImage(image_path, x, y, width=w, height=h)

Issue: Unicode characters not displaying

Register and use TrueType fonts:

from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

pdfmetrics.registerFont(TTFont('Arial', 'Arial.ttf'))
c.setFont('Arial', 12)

Resources

平台分布

Claude Code

29.8%
按下载量换算49

OpenCode

24.65%
按下载量换算41

Antigravity

15.44%
按下载量换算26

Gemini CLI

12.76%
按下载量换算21

windsurf

7%
按下载量换算12

trae

3.42%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills