Skip to main content

Automatic certificate generator with OCR-based placeholder detection

Project description

CertiGen 🎓

Automatic certificate generator with OCR-based placeholder detection. Generate hundreds of personalized certificates in seconds!

Features

  • 🔍 Auto-detect placeholder - Uses OCR to find "John Doe" or any placeholder text
  • 🎨 Auto-detect colors - Automatically extracts font and background colors
  • 📏 Smart text sizing - Automatically resizes text for long names
  • 📄 Multiple exports - PNG, PDF, or ZIP
  • ☁️ Cloud upload - S3 and Google Drive support
  • 📧 Email - Send certificates directly via email

Installation

pip install certigen

For OCR support (recommended):

pip install certigen[ocr]

For all features:

pip install certigen[all]

Tesseract OCR (Required for auto-detection)

  • Windows: Download from UB-Mannheim
  • macOS: brew install tesseract
  • Linux: sudo apt install tesseract-ocr

Quick Start

Python API

from certigen import CertificateGenerator

# Basic usage - auto-detects everything
gen = CertificateGenerator(
    template_path="template.png",
    excel_path="names.xlsx",
    name_column="Name",
    font_path="arial.ttf",
    placeholder="John Doe"
)
gen.generate_all()

# Export options
gen.export_as_pdf()
gen.zip_certificates()

Command Line

# Basic usage
certigen -t template.png -e names.xlsx -f arial.ttf

# With options
certigen -t template.png -e names.xlsx -f arial.ttf -p "John Doe" --pdf --zip

# Find coordinates interactively
certigen -t template.png --find-coords

Advanced Usage

Manual Position Override

If OCR doesn't detect the placeholder correctly:

gen = CertificateGenerator(
    template_path="template.png",
    excel_path="names.xlsx",
    name_column="Name",
    font_path="arial.ttf",
    manual_position=(800, 600),  # (x, y) center point
    font_color=(0, 0, 0),        # RGB black
    bg_color=(255, 255, 255),    # RGB white
)

Cloud Upload

# AWS S3
gen.upload_to_s3(
    bucket="my-bucket",
    access_key="...",
    secret_key="...",
)

# Google Drive
gen.upload_to_drive(
    credentials_path="service_account.json",
    folder_id="..."
)

Email Certificates

gen.email_certificates(
    smtp_server="smtp.gmail.com",
    smtp_port=587,
    sender_email="you@gmail.com",
    sender_password="app_password",
    recipient_emails=["recipient@example.com"]
)

CLI Options

Option Description
-t, --template Template image path (required)
-e, --excel Excel/CSV file with names (required)
-f, --font Font file path (required)
-c, --column Column name for names (default: "Name")
-o, --output Output directory (default: "output")
-p, --placeholder Placeholder text (default: "John Doe")
--font-color Font color as R,G,B
--bg-color Background color as R,G,B
--position Manual position as X,Y
--pdf Create combined PDF
--zip Create ZIP archive
--find-coords Interactive coordinate finder

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

certigen-1.0.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

certigen-1.0.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file certigen-1.0.0.tar.gz.

File metadata

  • Download URL: certigen-1.0.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for certigen-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f7ac1ff33d3779af43307662f95193c416fc8ec340a9177673b75f0fa6205246
MD5 e616137c86201aa82fb32a69e74b3ef0
BLAKE2b-256 e14dcfa91d1a5d296721e2b646dfb94336ecdc3c6f1a1cceb9e1fec5ffd849e8

See more details on using hashes here.

File details

Details for the file certigen-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: certigen-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for certigen-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8f28fc929e2c3f88bb632b380ccd26ceb676f2fd8ed1fc137d094f42adbaf54
MD5 78c84d7bb539415c5bde1133607738ca
BLAKE2b-256 c15da800b36871847150137872b803c44ee9fa8f36b1263c045e107bfa61b12e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page