Skip to main content

Generator for SwissQR invoice qr codes

Project description

swissqr

Python lib to generate the QR code of Swiss QR bills. Check here for more details on QR bills.

Beware: This library is not well tested, use at your own risk!

Quickstart:

import pathlib
from iso4217 import Currency
from swissqr import PaymentParty, QRData, SwissQR

# Create a PaymentParty object for the payment receiver
p = PaymentParty(
    name="Hambone Fakenamington",
    street="Madeup Street",
    street_no="1",
    zipcode="9999",
    city="Madeup Town",
    country="CH"
)

# Create QR code data model
d = QRData(
    iban="CH1234567890123456789",
    creditor=p,
    amount=5.0,
    currency=Currency.chf,
    message="Have a beer!"
)

# Create QR code object
q = SwissQR(d)

# Get QR code svg as a string
markup = q.get_markup()

# Save QR code to a file
p = pathlib.Path("/tmp/qr.svg")
q.save(p)

Installation

Install with pip/git:

pip install git+https://gitlab.com/dinuthehuman/swissqr.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swissqr-0.2.0.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

swissqr-0.2.0-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page