Git Product home page Git Product logo

certificate-generator-and-sender's Introduction

Certificate Generator and Sender

About

A command-line interface (CLI) tool developed to automate the complete workflow of generating certificates and sending them through personalized emails. Whether you're organizing an event or a workshop, this program offers an easy solution for automating the tasks related to certificate creation and online delivery.

Setup

# SET UP A VIRTUAL ENVIRONMENT
> python -m venv venv

# ACTIVATE THE VIRTUAL ENVIRONMENT
> source venv/Scripts/activate

# INSTALL THE DEPENDENCIES
(venv)> pip install -r requirements.txt
# ALTERNATIVELY, YOU CAN INSTALL THEM MANUALLY: pip install opencv-python pillow

# RUN THE SCRIPT
(venv)> python script.py

# ONCE FINISHED, DEACTIVATE THE VIRTUAL ENVIRONMENT
(venv)> deactivate

Command Line Help

# LIKE MOST CLI TOOLS, THIS PROGRAM SUPPORTS THE HELP COMMAND
(venv)> python script.py --help
usage: script.py [-h] [-a ACTIONS] [-c]

Certificate Generator and Sender

options:
  -h, --help            show this help message and exit
  -a ACTIONS, --actions ACTIONS
                        comma-separated list of actions to perform (preview, save, send),
                        at least one of preview or save must be selected (save is the default action),
                        example usage: --actions=save,send
  -c, --clear-run-output
                        delete the 'output/<run-id>' generated directory if send action was used,
                        example usage: --clear-run-output

Use Your Data

To tailor the certificate generation and email sending to your needs, you can modify the following files:

  • attendees.csv: This file contains lines in the format "fullname","email".
    It can be easily exported from a Google Form.

  • data.json: This file contains the template and email settings. Customize it as follows:

{
  "template": {
    "filename": "<str:name>.<png|jpg|jpeg>",
    "styles": {
      "font-filename": "<str:name>.<ttf>",
      "size": <int:size>,
      "fill-color": "<str:hex-color>",
      "top-coordinate": <int:top-coordinate>
    }
  },
  "email": {
    "sender-credentials": {
      "email": "<str:email>",
      "password": "<str:password>"
      "smtp-host": "<str:smtp-host>",
      "smtp-port": <int:smtp-port>
    },
    "subject": "<str:subject>",
    "body": "<str:body>",
    "attached-certificate-filename": "<str:attached-certificate-filename>"
  }
}

Note that:

  • Certificate templates are required to be located in the ./templates/ directory, and fonts in ./fonts/.
  • Only PNG and JPG/JPEG file formats for templates were tested, as well as TrueType Font (TTF) fonts, that explains my explicit preference for only accepting these formats.
  • The template.styles.font-filename parameter is optional and will default to FreeMono if not specified.
  • The template.sender-credentials.smtp-host and template.sender-credentials.smtp-port parameters are optional and will default to "smtp.gmail.com" and 465 respectively if not specified.
  • For programmatic email sending using a Gmail account, consider using App Passwords.
    Simply put the generated password in the data.json file.

Demo

  • Preview actions arg option:

preview-actions-arg-option

  • Save actions arg option:

save-actions-arg-option

  • Send actions arg option:

send-actions-arg-option

certificate-generator-and-sender's People

Contributors

thammami01 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.