This simple program creates conference badges given a CSV file with the appropriate column headers (please see example). In the badge, details of the attendee such as first name, last name, job title and company will be printed, along with a QRCode containing a VCARD.
A flag with the attendee country will be added as well. To remove this, simpy assign false
to the addFlag
variable.
The Flags of the attendee are retrieved from https://countryflagsapi.com/. I have noticed that with a poor connection, the whole script might cascade-fail trying to retrieve the flags. If you encounter this proble, just disable the flag retrieval.
while in the directory of the project. run the following to install all required modules:
pip3 install -r requirements.txt
dataFile
- CSV file containing your attendees.template
- Your base image file for the badge. UseKCDAMS2023_Badge_Template.png
for sizing reference.
To change the TrueType font used, update font
, font2
and font3
varible to point to your font path.
font
- used for First Namefont2
- used for Last Name and Job Titlefont3
- Used for Company Name
The Colour and Text at the bottom of the badge, is updated according to the attendee Discount
tier. Update the follwoing varialble values to your needs:
speaker
organizer
vip
student
sponsor
addFlag
- Used to enable/disable flag retrieval and addition.
The badge will be created as PDF. You can swtch the format to png by updating the extension in this function:
img_base.save(f"badges/{lastname}_{firstname}_{order}.pdf")
you can run confBadger by:
python3 confbadger.py
- The badges will be created in the
badges/
directory. - The QRCodes will be created in the
codes/
directory. - If enabled, the flags will be created in the
flags/
directory.
- Add Auto adjustment of text size and position
- Add option to remove source images
- Add code for base image drawing