> lastname,firstname,org,title,phone,email,website,street,city,p_code,country
> Doe,John,John Doe plc,Web Developer,143893456,john.doe@hjd.com,https://johndoe.com, 203 East 50th Steet,New York,10022,USA
> Morgan,Peter,Pythonfactory Inc.,Backend Developer,141996746,peter.morgan@hpythonfactory.com,https://pythonfactory.com,203 Weststeet,New York,10022,USA
import pyqrcode
import pandas as pd
def createQRCode():
df = pd.read_csv("havas.csv")
for index, values in df.iterrows():
lastname = values["lastname"]
firstname = values["firstname"]
title = values["title"]
phone = values["phone"]
email = values["email"]
website = values["website"]
org = values["org"]
street = values["street"]
city = values["city"]
p_code = values["p_code"]
country = values["country"]
data = f'''
"BEGIN:VCARD\n"
"N:{lastname};{firstname};\n"
"FN:{lastname}+{firstname}\n"
"TITLE:{title}\n"
"TEL;TYPE=work,VOICE:{phone}\n"
"EMAIL;WORK;INTERNET:{email}\n"
"URL:{website}\n"
"ORG:{org}\n"
"ADR;TYPE=work,PREF;;;{street};{city};{p_code};{country}\n"
"VERSION:3.0\n"
"END:VCARD\n"
'''
image = pyqrcode.create(data)
image.svg(f"{lastname}_{firstname}.svg", scale="5")
createQRCode()
I have a CSV file which contains several employees. From this file I would like to generate a Vcard QR code for each employee. Unfortunately, only the URL is retrieved when the QRCode is scanned.
Unfortunately, I do not recognise the error, as I am inexperienced in Python. I would be very grateful for your help!
