The Certificate Generator is a simple and dynamic course/event certificate generator. It is easy to use and highly customizable. One can simply generate a customized certificate by providing the certificate template, name of recipient, name of event and date of the event.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Certificate Generator requires Python (> Python 3.5) .
$ git clone https://github.com/gdsoumya/certificate-generator.git
or
Download and extract the Zip-FileThe Project has a few dependencies which can be installed by running.
$ cd certificate-generator
$ pip install -r dependencies.txt To configure the script edit the 'config.txt' file. A properly configured file should look like :
[SETTINGS]
TEMPLATE = template/example-template.jpg
[NAME]
NAME_FONT = fonts/Cookie-Regular.ttf
NAME_FONT_SIZE = 35
NAME_COLOR = rgb(0,0,0)
NAME_X = 122
NAME_Y = 220
NAME_WIDTH = 404
[EVENT]
EVENT_FONT = fonts/Kanit-Regular.ttf
EVENT_FONT_SIZE =30
EVENT_COLOR = rgb(0,0,0)
EVENT_X = 122
EVENT_Y = 318
EVENT_WIDTH = 404
[DATE]
DATE_FONT = fonts/Kanit-Regular.ttf
DATE_FONT_SIZE = 21
DATE_COLOR = rgb(0,0,0)
DATE_X = 90
DATE_Y = 375
DATE_WIDTH = 126
| OPTION | DESCRIPTION |
|---|---|
| TEMPLATE | Path of the Template (IMAGE) of the Certificate |
| *_FONT | Path of Font File (.ttf) that will be use for * field in the Certificate |
| *_FONT_SIZE | Font Size that will be use for * field in the Certificate |
| *_COLOR | Font Color that will be use for * field in the Certificate |
| *_X | X Co-ordinate from where the * field begins in the Certificate |
| *_Y | Y Co-ordinate from where the * field begins in the Certificate |
| *_WIDTH | Width of the * field in the Certificate |
The project comes with two example test files test.py and test-cli.py.
test.py : It is an example that demonstrates how Certificate Generator can be implemented in already existing projects.
$ python test.py
>> CERTIFICATE GENERATED AND SAVED AS : outputcertificate.png <<
STATUS : SUCCESSFULtest-cli.py : It is a cli based example that lets you test the script directly from the command line.
$ python test-cli.py -n "John Doe" -e "GREEN EARTH INITIATIVE" -d "01/02/2019" -o exampleCert.png
** DATA TO BE USED **
>> NAME : John Doe
>> EVENT : GREEN EARTH INITIATIVE
>> DATE : 01/02/2019
>> OUTPUT FILE : exampleCert.png
!! Is the Information Correct [y/n] :y
>> CERTIFICATE GENERATED AND SAVED AS : exampleCert.png <<- PILLOW : For Image Processing
- Configparser : For reading config file.
- Soumya Ghosh Dastidar
Any contribution/suggestions are welcomed.