How sanskaromar/certifai works
Project Type and Purpose
• Certifai is a Python-based certificate generator (an open-source tool/CLI application).
• It reads tabular data (CSV), populates a PowerPoint template, embeds QR codes, converts slides to PDF, and produces a Markdown summary.
• It leverages multiprocessing for speed and requires PowerPoint (COM) on Windows for PPTX→PDF conversion.
File Structure
• Top-level files:
• main.py – entry point
• config.json – user-customizable settings
• data.csv – input data
• certificate_template.pptx – PPTX template
• certificates.md / certificates_pdf/ – outputs
• requirements.txt – dependencies
• LICENSE.md, README.md, .gitignore
• No sub-directories besides the output folders. Temporary dirs created at runtime: certificates_pptx/, qr_codes/.
Extract Key Components from README
• Config loader reads config.json
• Data loader reads CSV
• Placeholder replacer uses python-pptx or COM API to fill text
• QR code generator library creates images linking to profile_url
• Multiprocessing manager dispatches rows to worker processes
• Each worker:
a. Replaces placeholders in a PPTX copy
b. Inserts QR code image
c. Saves temporary PPTX
d. Invokes PowerPoint COM to export PDF
e. Deletes temp PPTX/QR code images
f. Emits an entry for certificates.md
• Final outputs: a directory of PDFs + a Markdown summary
Relationships and Data Flow
• Config feeds into Data Module and into Multiprocessing Manager
• Data Module streams rows into Multiprocessing Manager
• Manager fans out rows to Worker Processes in parallel
• Template Copier → Placeholder Engine → QR Generator → PPTX→PDF Converter → Cleanup → Summary Buffer
Architectural Patterns & Principles
• Pipeline/Filter pattern: data → template → QR → PDF → summary
• Parallelism: multiprocessing pool to maximize throughput
• Modularity: each step is a separate module/function
• Configurable: behavior driven by config.json, CSV schema, and PPTX placeholders
Technologies & Frameworks
• Python 3.7+
• Multiprocessing library
• python-pptx or COM via pywin32
• qrcode / Pillow libraries
• Markdown writer (built-in file I/O)
• CSV standard library or pandas (if used)
• Windows PowerPoint COM
Detail Without Overthinking
• Every component from config loader to cleanup
• Data flow, dependencies, and parallel execution paths