This tools serves help for ESN sections to mass produce ESNcards, it gets input data from .csv
file downloaded from Application Google Form, downloads uploaded photos of applications, and generates .pdf
as print resources.
Install all requirements into your python3 environment -- all listed in requirements.txt
.
apt install python3 python3-venv pyton3-pip
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Download form responses in .csv format, expected headers:
Timestamp
in ISO formatEmail
Name and Surname (e.g. Walter White)
Country (e.g. Mexico)
Date of Birth (e.g. 07/09/98)
Upload a passport-sized photo of yourself (2.7x3.7 cm)
as google drive link
NOTE: The script expects data in certain columns. See
config.py
if you edit the Application form and data are in different columns. This usually happens with each new board. :)
NOTE: Remove any lines from the .csv file that are note the names - eg. empty rows and the column names (Name, Email, ...)
This only needs to be done once in the beginning.
File client_secret.json
(placed in project root) is needed to access Google Drive, you can get one from
Google APIs, especially
OAuth 2.0 Client IDs (with all Google Drive perms) for your own project.
Make sure you have set up the credentials from the previous step.
Then place .csv file containg the list of new student data you want to download
to the input/
folder.
Finally, run the following command:
python3 download_images.py input/<downloaded_form_file>.csv
Make sure restrict input data fomrat in the google sheet to images. This script should accept all valid image formats and converts them to jpeg in the background.
So the typical usage would be:
To render just labels to print them on transparent foil, output is output-text-<datetime>.pdf
:
python3 generate.py --mode text
To render just photos to print, output is output-photo-<datetime>.pdf
:
python3 generate.py --mode photo
In photo mode, the script sometimes detects multiple faces. U need to looks in folder decisions/
to see which of the detections is an actual face. Then in the command line write the number of
the detection.
- IT department of ESN VUT Brno:
- Jozef Zuzelka
- Joe Kolář
- Roman Krček