Finnish virtuaaliviivakoodi generation
Virtuaaliviivakoodi is a Python library for generating and deconstructing virtual barcodes based on Finanssiala's pankkiviivakoodi spec.
Installation
pip install virtuaaliviivakoodi
Usage
Creating a virtual barcode
from virtuaaliviivakoodi import virtuaaliviivakoodi
virtuaaliviivakoodi(
iban="FI49 5000 9420 0287 30",
reference="12345 67907",
due_date=date(2022, 12, 12),
euro_amount=100.20,
)
# > "449500094200287300001002000000000000001234567907201212"
Deconstructing a virtual barcode
from virtuaaliviivakoodi import deconstruct_virtuaaliviivakoodi
deconstruct = deconstruct_virtuaaliviivakoodi("449500094200287300001002000000000000001234567907201212")
# > deconstruct.symbol = SymbolVersion.VERSION_4,
# deconstruct.iban = FI4950009420028730,
# deconstruct.euro_amount = Decimal('100.20'),
# deconstruct.reference = 1234567907,
# deconstruct.due_date = date(2022, 12, 12),
Function arguments
Creating a virtual barcode
| Argument | Type | Description |
|---|---|---|
iban |
str |
Mandatory. Payment receiver's IBAN. Must be in Finnish format. E.g.: "FI49 5000 9420 0287 30" or "FI4950009420028730" |
reference |
str int |
Mandatory. Invoice reference in Finnish or international (RF) format. May invluce whitespace characters. E.g. "12345 67907", "1234567907", 1234567907 or "RF92 1234 2345" |
euro_amount |
float int Decimal |
Mandatory. Invoice total amount in Euros. Must be positive number. According the spec amount must be smaller than 1000000. |
due_date |
date |
Optional. Invoice due date as a Python date object. If left empty, "000000" is used as the date according to the spec |
Deconstructing a virtual barcode
| Argument | Type | Description |
|---|---|---|
virtuaaliviivakoodi |
str |
Mandatory. Virtuaaliviivakoodi to deconstruct. E.g.: "449500094200287300001002000000000000001234567907201212" |
Exceptions
Exceptions can be imported the following way:
from virtuaaliviivakoodi.exceptions import (
VirtuaaliviivakoodiException,
InvalidIBANException,
InvalidReferenceException,
InvalidEuroAmountException,
InvalidDueDateException,
InvalidSymbolException,
InvalidLengthException
)
| Exception | Description |
|---|---|
VirtuaaliviivakoodiException |
Base exception class for all of the following exceptions. |
InvalidIBANException |
Raised for invalid IBANs |
InvalidReferenceException |
Raised for invalid references |
InvalidEuroAmountException |
Raised for invalid euro amounts |
InvalidDueDateException |
Raised for invalid due dates |
InvalidSymbolException |
Raised for invalid symbol version of the virtuaaliviivakoodi |
InvalidLengthException |
Raised for invalid length of the virtuaaliviivakoodi |
Metadata
Release files for virtuaaliviivakoodi 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| virtuaaliviivakoodi-1.1.0.tar.gz | 7.6 kB | Without provenance | Details for virtuaaliviivakoodi-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| virtuaaliviivakoodi-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for virtuaaliviivakoodi-1.1.0-py3-none-any.whl |
Total release size: 21.4 kB
Release files / virtuaaliviivakoodi-1.1.0.tar.gz
| Download URL | virtuaaliviivakoodi-1.1.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
587b295243b9d2eb1430fdb84957b40c45b8bff7abf0d67d573940ae8a6d7492
|
|
BLAKE2b-256 checksum How to use checksums |
eedf461e956c598343452c1aea1295b4d0fa2c6de07acad116dfe4b8544dae12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.4 Darwin/24.0.0
|
Release files / virtuaaliviivakoodi-1.1.0-py3-none-any.whl
| Download URL | virtuaaliviivakoodi-1.1.0-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10ed9a1e5ea4ab8a0fce4541defca46a9957b27cdeea421e9588f5d3d49906a6
|
|
BLAKE2b-256 checksum How to use checksums |
861115ce54c00191386c5b6049e94e6fb1eca3338d6c492d2c43920ef6232450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.4 Darwin/24.0.0
|
Security for virtuaaliviivakoodi 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.