lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.34k stars 664 forks source link

Allow fine-tuning of SVG output by forwarding keyword arguments #250

Closed agnat closed 2 years ago

agnat commented 2 years ago

Forwarding the kwargs in SvgFragmentImage.new_image() allows additional fine-tuning of the resulting SVG node. Similarly, adding kwargs to the to_string() method helps to adjust things like the string encoding:

qr = qrcode.QRCode(image_factory=qrcode.image.svg.SvgPathImage)
svg_str = qr.make_image(attrib={'class': 'some-css-class'}).to_string(encoding='unicode')

Both features are mentioned in the README. Let me know what you think...