-
-
Save ozett/f700a3dcaec0681c2de80c089b8df380 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qrcode | |
def createQr(vwz,iban,bic,recipient,amount,filename="epc_qr"): | |
# The docs can be found here: https://pypi.org/project/qrcode/ | |
qr = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_M) | |
qr.add_data("BCD\n") | |
qr.add_data("002\n") | |
qr.add_data("1\n") | |
qr.add_data("SCT\n") | |
qr.add_data(bic+"\n") | |
qr.add_data(recipient[0:69]+"\n") | |
qr.add_data(iban+"\n") | |
qr.add_data("EUR"+str(amount)+"\n") | |
qr.add_data("\n") | |
qr.add_data("\n") | |
qr.add_data(vwz[0:139]+"\n") | |
qr.make(fit=True) | |
img = qr.make_image() | |
img.save(filename+".png") | |
purpose = "Rechnung äöü123456789" | |
iban = "DE02100500000054540402" | |
bic = "BELADEBE" | |
recipient = "Beispielempfänger Musterdorf" | |
amount = 55.22 | |
createQr(purpose,iban,bic,recipient,amount) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment