Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 699 Bytes

QCardGeneration.md

File metadata and controls

41 lines (28 loc) · 699 Bytes

QCard Generation

Python

Requirements

$ pip install vobject

Example

import vobject
import base64

card = vobject.vCard()
card.add('n')
card.n.value = vobject.vcard.Name(given='Arran')
card.add('fn')
card.fn.value = "Arran"

card.add('email')
card.email.value = '[email protected]'

card.add('tel')
card.tel.value = '+555'

card.add('url')
card.url.value = 'https://arran.nz'

card.add('note')
card.note.value = 'Here I go, making cards in Python again'

serializedCard = card.serialize()
encodedCard = base64.b64encode(serializedCard.encode())

print("https://qcard.link/?v={}".format(encodedCard.decode()))