Skip to main content

Generate EPC-compatible QR codes for wire transfers

Project description

Code style: black codecov tests lint_with_black

Create QR codes for wire transfers

Sick of copy-and-pasting IBANs to forms? Why not just scan a QR code and have your favorite banking app take care of the rest?

Why not be generous and support wikipedia with EUR10? Grab your phone, open your banking app, select the QR scanner and scan the image below which was created with this tool.

Support Wikipedia with 10 €

Support Wikipedia with 10 €

The created QR code complies with the European Payments Council (EPC) Quick Response (QR) code guidelines.

1st Disclaimer: The author of this code has no affiliation with the EPC whatsoever. Henceforth, you are welcome to use the code at your own dispense, but any use is at your own (commercial) risk.

2nd Disclaimer: Currently, the EPC specifications are implemented only to work with IBAN-based consumer wire transfers within the European Economic Area (EEA), i.e. using the following pieces of information:

  • Recipient
  • IBAN
  • Amount
  • Unstructured remittance (aka reason for transfer)

Of course, any helping hand is welcome to extend the core functionality to more generic transactions.

Installation

To use the code as a standalone command line interface (CLI) tool, then use pipx as follows

pipx install py-epc-qr

You may verify the installation by calling epcqr version. The output should be identical to what pipx printed.

If you intend to use the code instead directly in your own Python projects, then install the package using pip

pip install py-epc-qr

Usage

You may use the package as a standalone command line interface (CLI) or as part of your own code.

CLI

Having installed the package with pipx (see above), you may verify the installation upon calling

>> epcqr --help
Usage: epcqr [OPTIONS] COMMAND [ARGS]...

  Create EPC-compliant QR codes for wire transfers.

Options:
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.
  --help                          Show this message and exit.

Commands:
  create   Create EPC-compliant QR code for IBAN-based wire transfer...
  version  Show version and exit.

The last lines show the available commands.

The core functionality lies behind create, for which you can call again the help.

epcqr create --help     
Usage: epcqr create [OPTIONS]

  Create EPC-compliant QR code for IBAN-based wire transfer within European
  economic area.

Options:
  --out TEXT        name of generated qr png file  [default: qr.png]
  --from-yaml TEXT  specify yaml file from which to create qr
  --help            Show this message and exit.

From interaction

If you call the create command without any options, it is started in an interactive mode. You are asked to input all relevant information. If your input is correct, an image will be created in your current directory.

From template

Alternatively, you can create the QR code from a yaml template, for which the repository contains an example.

Code

If you intend to use the source code in your own Python projects, then a minimal working example looks as follows:

from py_epc_qr.transaction import consumer_epc_qr
epc_qr = consumer_epc_qr(
    beneficiary= "Wikimedia Foerdergesellschaft",
    iban= "DE33100205000001194700",
    amount= 123.45,
    remittance= "Spende fuer Wikipedia"
    )
epc_qr.to_qr()

The relevant functions are gathered in transaction.py

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

py-epc-qr-0.1.3.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

py_epc_qr-0.1.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file py-epc-qr-0.1.3.tar.gz.

File metadata

  • Download URL: py-epc-qr-0.1.3.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.10 Darwin/21.4.0

File hashes

Hashes for py-epc-qr-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b734ecc536cf0b1d628a92644299048d21198e8f2553191d90b1c06a4191e1cd
MD5 3574069c336671b328572edd8869124e
BLAKE2b-256 76c0a88a1f96516b17d1abcbfaccc202d18d404863754df117236d498ca5cc76

See more details on using hashes here.

File details

Details for the file py_epc_qr-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: py_epc_qr-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.10 Darwin/21.4.0

File hashes

Hashes for py_epc_qr-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 29056d633a01834faf406e168f6b5e66f95e295d81151537e9730b0115e7d42d
MD5 a973bdcb1e516e850e0229e535133058
BLAKE2b-256 35fa22635a5d9e3a9448cc79a0e966547921618589a3cbc300b5972bc0da7cdb

See more details on using hashes here.

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