certificate-generator について
certificate-generatorは、講座、イベント、実績、表彰向けの証明書を作成し、PDFで出力します。既定のデザイン、ブランド要素や署名の設定に加え、CSVからの一括生成にも対応します。
主な機能
- 015種類の既定テンプレート
- 02ロゴ、色、署名の追加
- 03CSVデータからの証明書生成
- 04受取人や実績などの動的項目
- 05一意の証明書IDの付与
- 06縦向きまたは横向きPDFでの出力
活用シーン
- 01講座修了証の発行
- 02イベント参加証の作成
- 03社員研修証明書の一括生成
- 04組織のブランド要素を含む表彰状の作成
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ dkyazzentwatwa/ chatgpt-skills --skill certificate-generatorインストール後、Claude Code で/certificate-generatorを入力して読み込まれたか確認します。
同梱ファイルscripts/certificate_gen.pyscripts/requirements.txt
詳細
証明書ジェネレーター
講座、実績、イベント、受賞のためのプロフェッショナルな証明書を作成します。カスタマイズ可能なテンプレートとブランディングを使用し、CSV ファイルからの一括生成に対応しています。
クイックスタート
from scripts.certificate_gen import CertificateGenerator
# Single certificate
cert = CertificateGenerator()
cert.set_title("Certificate of Completion")
cert.set_recipient("John Smith")
cert.set_achievement("Python Programming Course")
cert.set_date("December 14, 2024")
cert.generate().save("certificate.pdf")
# Batch from CSV
CertificateGenerator.batch_generate(
"students.csv",
template="achievement",
title="Certificate of Completion",
achievement="Data Science Bootcamp",
output_dir="./certificates/"
)
機能
- プロフェッショナルなテンプレート:モダン、クラシック、エレガント、ミニマルなスタイル
- カスタムブランディング:ロゴ、色、署名
- 一括生成:CSV から数百枚の証明書を作成
- 動的フィールド:氏名、日付、実績、講師など
- 署名:肩書き付きのテキストまたは画像による署名
- 証明書 ID:一意の識別子を自動生成
- エクスポート:PDF 出力、横向きまたは縦向き
API リファレンス
初期化
cert = CertificateGenerator()
# With template
cert = CertificateGenerator(template="elegant")
証明書の内容
# Title
cert.set_title("Certificate of Completion")
cert.set_title("Certificate of Achievement")
# Recipient name
cert.set_recipient("Jane Doe")
# Achievement/course/event
cert.set_achievement("Advanced Python Programming")
cert.set_achievement("for outstanding performance in the 2024 Hackathon")
# Description (optional)
cert.set_description(
"Has successfully completed the 40-hour intensive course "
"covering advanced topics in Python programming."
)
# Date
cert.set_date("December 14, 2024")
cert.set_date_auto() # Use today's date
# Certificate ID (auto-generated if not set)
cert.set_certificate_id("CERT-2024-001")
ブランディング
# Organization name
cert.set_organization("Acme Academy")
# Logo
cert.set_logo("logo.png")
cert.set_logo("logo.png", width=200)
# Colors
cert.set_colors(
primary="#1e3a5f", # Main color (title, borders)
accent="#c9a227", # Accent color (decorations)
text="#333333" # Text color
)
署名
# Text signature
cert.add_signature(
name="Dr. Jane Smith",
title="Program Director"
)
# Multiple signatures
cert.add_signature("John Doe", "CEO")
cert.add_signature("Jane Smith", "Head of Training")
# Image signature
cert.add_signature(
name="Dr. Jane Smith",
title="Program Director",
signature_image="signature.png"
)
テンプレート
# Available templates
cert.set_template("modern") # Clean, contemporary design
cert.set_template("classic") # Traditional, formal design
cert.set_template("elegant") # Decorative borders, serif fonts
cert.set_template("minimal") # Simple, clean design
cert.set_template("academic") # University/school style
# Orientation
cert.set_orientation("landscape") # Default
cert.set_orientation("portrait")
生成とエクスポート
# Generate certificate
cert.generate()
# Save to PDF
cert.save("certificate.pdf")
# Get PDF bytes
pdf_bytes = cert.to_bytes()
一括生成
CSV から生成
# CSV with recipient data
CertificateGenerator.batch_generate(
csv_file="students.csv",
template="achievement",
title="Certificate of Completion",
achievement="Python Fundamentals",
organization="Code Academy",
output_dir="./certificates/"
)
CSV 形式
name,date,course,certificate_id
John Smith,2024-12-14,Python 101,CERT-001
Jane Doe,2024-12-14,Python 101,CERT-002
Bob Johnson,2024-12-14,Python 101,CERT-003
プログラムによる一括生成
recipients = [
{"name": "John Smith", "course": "Python 101"},
{"name": "Jane Doe", "course": "Data Science"},
{"name": "Bob Johnson", "course": "Machine Learning"}
]
for r in recipients:
cert = CertificateGenerator(template="modern")
cert.set_title("Certificate of Completion")
cert.set_recipient(r["name"])
cert.set_achievement(r["course"])
cert.set_date_auto()
cert.generate()
cert.save(f"certificates/{r['name'].replace(' ', '_')}.pdf")
CLI の使い方
# Single certificate
python certificate_gen.py \
--recipient "John Smith" \
--title "Certificate of Completion" \
--achievement "Python Course" \
--output certificate.pdf
# With options
python certificate_gen.py \
--recipient "Jane Doe" \
--title "Certificate of Achievement" \
--achievement "Excellence in Data Science" \
--organization "Data Academy" \
--template elegant \
--logo logo.png \
--output achievement.pdf
# Batch from CSV
python certificate_gen.py \
--batch students.csv \
--title "Certificate of Completion" \
--achievement "Bootcamp Graduate" \
--template modern \
--output-dir ./certificates/
CLI 引数
| 引数 | 説明 | デフォルト |
|---|---|---|
--recipient | 受取人の氏名 | 必須 |
--title | 証明書のタイトル | Certificate |
--achievement | 実績のテキスト | - |
--description | 説明文 | - |
--organization | 組織名 | - |
--date | 証明書の日付 | 今日 |
--template | テンプレートのスタイル | modern |
--logo | ロゴ画像のパス | - |
--output | 出力する PDF のパス | certificate.pdf |
--batch | 一括生成用の CSV ファイル | - |
--output-dir | 出力ディレクトリ(一括生成) | ./ |
テンプレート
モダン
すっきりとした現代的なデザインです。以下の特徴があります。
- サンセリフ体フォント
- 装飾を最小限に抑えたデザイン
- 鮮やかなアクセントカラー
- プロフェッショナルな印象
クラシック
伝統的なデザインです。以下の特徴があります。
- セリフ体フォント
- フォーマルなレイアウト
- 枠線による装飾
- 時代を超えた優雅さ
エレガント
装飾的なデザインです。以下の特徴があります。
- 華やかな枠線
- 氏名にスクリプト体フォントを使用
- ゴールドのアクセント
- 高級感のある印象
ミニマル
シンプルなデザインです。以下の特徴があります。
- すっきりとしたタイポグラフィ
- 装飾なし
- 広い余白
- モダンなシンプルさ
アカデミック
大学風のデザインです。以下の特徴があります。
- 校章・紋章の配置
- フォーマルなタイポグラフィ
- 公式な印象
- 伝統的なレイアウト
例
講座修了証
cert = CertificateGenerator(template="modern")
cert.set_title("Certificate of Completion")
cert.set_recipient("John Smith")
cert.set_achievement("Full Stack Web Development")
cert.set_description(
"Has successfully completed the 12-week intensive program "
"covering HTML, CSS, JavaScript, React, Node.js, and databases."
)
cert.set_organization("Tech Academy")
cert.set_logo("tech_academy_logo.png")
cert.set_date("December 14, 2024")
cert.add_signature("Sarah Johnson", "Program Director")
cert.generate().save("completion_cert.pdf")
実績表彰状
cert = CertificateGenerator(template="elegant")
cert.set_title("Certificate of Achievement")
cert.set_recipient("Jane Doe")
cert.set_achievement("First Place - Annual Hackathon 2024")
cert.set_organization("Innovation Labs")
cert.set_colors(primary="#1a1a2e", accent="#d4af37")
cert.add_signature("Michael Chen", "CEO")
cert.add_signature("Emily Brown", "CTO")
cert.generate().save("achievement_award.pdf")
ワークショップ参加証
cert = CertificateGenerator(template="minimal")
cert.set_title("Certificate of Participation")
cert.set_recipient("Bob Wilson")
cert.set_achievement("Machine Learning Workshop")
cert.set_description("Attended the 2-day intensive workshop on Dec 12-13, 2024")
cert.set_date_auto()
cert.generate().save("workshop_cert.pdf")
従業員研修の一括生成
# training_completed.csv
# name,department,course
# Alice,Engineering,Safety Training
# Bob,Sales,Product Training
# Carol,HR,Compliance Training
CertificateGenerator.batch_generate(
csv_file="training_completed.csv",
template="classic",
title="Training Completion Certificate",
organization="Acme Corp",
logo="acme_logo.png",
output_dir="./training_certs/",
filename_pattern="{name}_{course}.pdf"
)
依存関係
reportlab>=4.0.0
Pillow>=10.0.0
制限事項
- PDF 出力のみ(PNG/画像形式でのエクスポートには非対応)
- 定義済みのテンプレートのみ(カスタム HTML/CSS には非対応)
- 1 枚の証明書につき署名は最大 3 つ
- ロゴは PNG または JPEG 形式である必要があります
- テンプレートは英語のみ(右から左に記述する言語には非対応)
コメント
Markdown 対応