WCC Certificate Automation

Automated certificate generation from PowerPoint templates and converting them to PDF format using JSON configuration

⚠️ Warning: PDF conversion currently only works on Windows The PDF export functionality uses Microsoft PowerPoint COM automation via comtypes, which is only available on Windows. On macOS and Linux, the script will generate PPTX files, but PDF conversion will not work.

Prerequisites

Installation

Install required Python packages:

   pip install -r requirements.txt

Dependencies

Project Structure

wcc_certificate_automation/
├── README.md                          # This file
├── requirements.txt                   # Python dependencies
├── src/
│   ├── config.json                   # Main configuration file
│   └── generate_certificates.py      # Main automation script
└── data/
    ├── input/
    │   ├── templates/                # PPTX template files
    │   │   ├── mentee.pptx
    │   │   └── mentor.pptx
    │   └── names/                    # Names text files
    │       ├── mentees.txt
    │       └── mentors.txt
    └── output/                        # Generated certificates
        ├── ppts/                      # Generated PPTX files
        │   ├── mentee/
        │   └── mentor/
        └── pdfs/                      # Generated PDF files
            ├── mentee/
            └── mentor/

Configuration

Edit src/config.json to customize certificate generation settings.

Config File

{
  "certificate_types": [
    {
      "type": "mentee",
      "template": "../data/input/templates/mentee.pptx",
      "names_file": "../data/input/names/mentees.txt",
      "pdf_dir": "../data/output/pdfs/mentee/",
      "ppt_dir": "../data/output/ppts/mentee/",
      "placeholder_text": "Sample Sample",
      "qr_left_cm": 47.8,
      "qr_top_cm": 28.91,
      "qr_width_cm": 3.0,
      "qr_height_cm": 3.0
    }
  ]
}

Required Parameters

Optional Parameters (QR Code Position)

Note: If QR position parameters are not specified, the QR code will be placed in the top-right corner by default.

Text Formatting

All text formatting (font name, font size, color, bold, italic, underline) is automatically preserved from the placeholder text in your PowerPoint template. Simply style the placeholder text (“Sample Sample”) in your template exactly how you want the names to appear, and the script will apply the same formatting to each person’s name.

Names Files

Create text files in data/input/names/ with one name per line:

Example (data/input/names/mentees.txt):

John Smith
Jane Doe
Alice Johnson

Template Files

Create PPTX template files in data/input/templates/ with text placeholder:

Example (data/input/templates/mentee.pptx):

Usage

Navigate to the src directory and run the main script:

cd src
python generate_certificates.py

The script will automatically:

  1. Check for duplicate names in the input files
  2. Generate PPTX certificates for each person
  3. Verify all PPTX certificates were created
  4. Convert all PPTX certificates to PDF format
  5. Verify all PDF certificates were created
  6. Display summary statistics

Output Format

Generated certificate files are named using the person’s name directly:

QR Code Verification

Each generated certificate includes a QR code for verification purposes. The system automatically:

  1. Generates Unique Certificate IDs: Each certificate gets a unique ID based on the recipient’s name, certificate type, and issue date
  2. Embeds QR Codes: QR codes are automatically added to the bottom-right corner of each certificate
  3. Maintains Certificate Registry: All issued certificates are recorded in data/output/certificate_registry.json
  4. Provides Verification Page: Recipients can verify certificates at https://www.womencodingcommunity.com/verify

How Verification Works

  1. For Recipients: Scan the QR code on your certificate or visit the verification page and enter your certificate ID
  2. For Verifiers: The verification page checks the certificate against the official registry and displays:
    • Certificate ID
    • Recipient name
    • Certificate type
    • Issue date
    • Validation status

Certificate Registry

The certificate registry (data/output/certificate_registry.json) contains all issued certificates:

{
  "certificates": [
    {
      "id": "ABC123DEF456",
      "name": "John Smith",
      "type": "mentee",
      "issue_date": "2026-01-04",
      "verification_url": "https://www.womencodingcommunity.com/verify?cert=ABC123DEF456"
    }
  ]
}

Important: The certificate registry file must be committed to the repository and deployed to GitHub Pages for the verification system to work.

Publishing Certificates for Web Verification

After generating certificates, you need to publish the certificate registry to make it available on the website:

  1. Generated Registry Location: tools/certificate_automation/data/output/certificate_registry.json
  2. Published Registry Location: assets/js/certificates_registry.json

Option 1: Manual Copy (First Time)

If this is your first batch of certificates:

cp tools/certificate_automation/data/output/certificate_registry.json assets/js/certificates_registry.json
git add assets/js/certificates_registry.json
git commit -m "Add certificate registry for verification"
git push

If you already have certificates published and want to add new ones:

python3 tools/certificate_automation/scripts/publish_registry.py

The script will:

Then commit and push:

git add assets/js/certificates_registry.json
git commit -m "Add new certificates to registry"
git push

Note: The tools/ directory is for generation only and can be deleted/recreated. The assets/js/certificates_registry.json file is served by the website.

Sample Logs

Generating MENTEE mentee certificates at ../data/output/ppts/mentee/
[1/68] Generated: ../data/output/ppts/mentee/John Smith.pptx
[2/68] Generated: ../data/output/ppts/mentee/Jane Doe.pptx
...

Successfully generated 68/68 mentee certificates

Checking metrics MENTEE certificates

Expected certificates: 68
Found certificates: 68

All mentee certificates are present!

Generating MENTEE mentee certificates at ../data/output/pdfs/mentee/
[1/68] Generated: ../data/output/pdfs/mentee/John Smith.pdf
...

Type: mentee Total: 68 PPTX Generated: 68 PDF Generated: 68

Certificate registry saved with 68 total certificates