- Fixed exception in
netsgiro.records.TransactionAmountItem2.to_ocr()
if~netsgiro.records.TransactionAmountItem2.payer_name
wasNone
. - Fixed exception in
netsgiro.records.TransactionAmountItem3.to_ocr()
if~netsgiro.records.TransactionAmountItem3.text
wasNone
. Raise a
ValueError
if a too long string is used for any of:netsgiro.records.TransactionAmountItem1.kid
(max 25 chars)netsgiro.records.TransactionAmountItem3.text
(max 40 chars)netsgiro.records.TransactionSpecification.text
(max 40 chars)netsgiro.records.AvtaleGiroAgreement.kid
(max 25 chars)
Previously the string was accepted and the record generated invalid OCR data.
Strip newline characters (
\n
and\r
) from record strings, likenetsgiro.records.TransactionAmountItem2.payer_name
.Previously the newline characters were accepted and the record generated invalid OCR data.
- Automatically pad
netsgiro.records.TransactionSpecification.text
to 40 chars, so that a manually created record and a record parsed from OCR are identical.
No changes from v1.0.0a3, which has been used in production for a few weeks without any issues.
- Rename
netsgiro.TransactionType.AVTALEGIRO_AGREEMENTS
(plural) tonetsgiro.TransactionType.AVTALEGIRO_AGREEMENT
(singular). - When writing record to OCR, cut
netsgiro.records.TransactionAmountItem2.payer_name
to 10 first chars, as that is all the field has room for.
Major improvements and changes.
- The objects API now supports parsing all known file variants with
netsgiro.parse
and can recreate the parsed OCR data perfectly withnetsgiro.Transmission.to_ocr
. - The objects API now does all the bookkeeping necessary for building payment requests. With this improvement, the code necessary to produce a payment request is cut to from around 100 to 25 lines of code.
- New
quickstart guide <quickstart>
shows how to parse files and build payment requests. - All public methods and fields of both the
objects API <objects>
andrecords API <records>
are now documented. - The low-level
records API <records>
has been moved to thenetsgiro.records
module.
Initial alpha release. No promises about backwards compatibility.