Structured Append

The Structured Append mode can be used to split a message across several QR codes (it’s not available for Micro QR codes).

Example: The 2-L QR code encodes the same information (“I read the news today oh boy”) as the following 1-L QR codes which are using Structured Append:

2-L QR code encoding 'I read the news today oh boy'

With Structured Append (version 1):

1-L QR code encoding 'I read the news today oh boy' part 1/21-L QR code encoding 'I read the news today oh boy' part 2/2

Segno provides a special factory function, segno.make_sequence(), to create a sequence of (up to 16) QR codes. The function returns instances of segno.QRCodeSequence.

Structured Append by QR Code version

To create a sequence of QR codes, the QR Code version must be specified. The number of symbols is automatically determined by the QR Code version.

>>> import segno
>>> seq = segno.make_sequence('I read the news today oh boy', version=1)
>>> len(seq)
2
>>> # Creates "a-day-in-the-life-02-01.svg" and "a-day-in-the-life-02-02.svg"
>>> seq.save('a-day-in-the-life.svg', scale=10)

If the provided content fits into one QR code, the sequence behaves like a segno.QRCode instance.

>>> import segno
>>> seq = segno.make_sequence('I read', version=1)
>>> len(seq)
1
>>> seq.designator
'1-H'
>>> # Creates "a-day-in-the-life.svg"
>>> seq.save('a-day-in-the-life.svg', scale=10)

Structured Append by number of symbols

The number of desired QR code symbols may be specified directly. The utilized QR Code version is automatically determined by the number of symbols.

>>> import segno
>>> seq = segno.make_sequence('Day after day, alone on the hill', symbol_count=4)
>>> [qr.designator for qr in seq]
['1-Q', '1-Q', '1-Q', '1-Q']
>>> seq = segno.make_sequence('Day after day, alone on the hill', symbol_count=2)
>>> [qr.designator for qr in seq]
['2-Q', '2-Q']
>>> seq = segno.make_sequence('Day after day, alone on the hill', symbol_count=6)
>>> [qr.designator for qr in seq]
['1-Q', '1-Q', '1-H', '1-H', '1-H', '1-H']

Example: The 6-L QR code encodes the same information (first verse of the song “Yesterday”) as the four 2-L QR codes.

6-L QR code encoding 'Yesterday...'

The following 2-L QR codes were created by specifying that 4 codes should be generated (symbol_count=4 ). The result would be the same if the user specifies that a sequence of QR codes with version 2 should be created.

2-L QR code encoding first verse of 'Yesterday' part 1/42-L QR code encoding first verse of 'Yesterday' part 2/42-L QR code encoding first verse of 'Yesterday' part 3/42-L QR code encoding first verse of 'Yesterday' part 4/4