exabyteCert is a Flask Application, which can be used to generate Certificates and also serves the purpose of distribution of Certificates.
exabyteCert
├── README.md
├── app
│ ├── __init__.py
│ ├── main
│ │ ├── __init__.py
│ │ ├── certs
│ │ │ └── certificates.pdf
│ │ ├── cli.py
│ │ ├── forms.py
│ │ ├── routes.py
│ │ └── templates
│ │ ├── certificates.html
│ │ └── index.html
│ ├── models.py
│ └── utils
│ ├── __init__.py
│ └── cert.py
├── config.py
├── example.env
└── requirements.txt- app/: Application directory.
- main/: Web application and CLI application is present in this directory.
- certs/: Generated Certificates are stored here.
- utils/: Utility tools are kept under this directory.
- main/: Web application and CLI application is present in this directory.
- config.py: Contains configuration of the Flask Appication.
- requirements.txt: Required Python Packages to run this Application.
After cloning this repository, create a new .env file and copy the content of example.env to .env file and replace YOUR_SECRET_KEY with yours.
Assuming, you are a regular user of virtualenv, create and activate the Virtual Environment and run:
$ pip install -r requirements.txtAfter installing the required packages, it must be told where your FLASK_APP is located. To do the same, run:
$ export FLASK_APP=appexabyteCert uses Flask-Migrate in order to implement the Database Migration.
Run the following commands:
$ flask db init
$ flask db migrate -m "initial migration"
$ flask db upgradeThis will create the Database and apply migration.
The Command Line Application is made to generate Certificates and manage them.
In order to generate Certificates, follow the steps.
To create a event run:
$ flask certs create-events -e EventNameTo create multiple events, run:
$ flask certs create-events -e Event1 -e Event2To view all the events that were already created, run:
$ flask certs show-eventsTo update name of an existing event, run:
$ flask certs update-event -o EventOldName -n EventNewNameNote: This command will not make changes on the Certificates.
To delete an existing event, run:
$ flask certs delete-event -e EventNameWARNING: This command will also delete all the Certificates linked with the Event.
To generate Certificates for a Event, run:
$ flask certs generate-certs -y [YAMLFILE] -c [CSVFILE] -e [EVENTNAME]- YAMLFILE: Path of a YAML File containing all the Certificate Template, Font and other necessary instructions. The YAML File must follow the following format.
template: "Blank-Certificate.jpg" # Blank Certificate
font:
name: "FontName.ttf" # Truetype Font File
size: 60 # Font Size
participantBox: [1687, 1263, 3073, 1351]
# Participant Name Box [Left, Top, Right, Bottom] in List
eventBox: [1280, 1387, 2172, 1475]
# Event Name Box [Left, Top, Right, Bottom] in List
title: "Certificate PDF Title" # PDF Title
author: "Author's Name" # Author's Name-
CSVFILE: Path of a CSV File containing the List of Participants of a Particular Event.
Tips: Try naming the csv file after an event.
The CSV File must follow the following format:
name,email
Name1,[email protected]
...- EVENTNAME: An Existing Event.
After Certificate generation, run the application:
$ flask runThe Application will run on 5000 port by default.
To run on your preferred port, replace PORT_NUMBER with your preferred port number and run:
$ flask run --port=<PORT_NUMBER>