-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
1,081 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../CHANGES.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Creating a QR Code encoding contact information | ||
=============================================== | ||
|
||
MeCard | ||
------ | ||
|
||
The function :py:func:`segno.helpers.make_mecard` returns a QR Code which encodes | ||
contact information as MeCard. | ||
|
||
.. code-block:: python | ||
>>> from segno import helpers | ||
>>> qr = helpers.make_mecard(name='Doe,John', email='me@example.org', phone='+1234567') | ||
>>> qr.designator | ||
'3-L' | ||
>>> # Some params accept multiple values, like email, phone, url | ||
>>> qr = helpers.make_mecard(name='Doe,John', email=('me@example.org', 'another@example.org'), url=['http://www.example.org', 'https://example.org/~joe']) | ||
>>> qr.save('my-mecard.svg') | ||
A factory function which returns the MeCard as string is available as well. | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> from segno import helpers | ||
>>> mecard = helpers.make_mecard_data(name='Doe,John', email='me@example.org', phone='+1234567') | ||
>>> mecard | ||
'MECARD:N:Doe,John;TEL:+1234567;EMAIL:me@example.org;;' | ||
>>> qr = segno.make(mecard, error='H') | ||
>>> qr.designator | ||
'6-H' | ||
vCard | ||
----- | ||
|
||
The function :py:func:`segno.helpers.make_vcard` returns a QR Code which encodes | ||
contact information as vCard version 3.0. | ||
|
||
.. code-block:: python | ||
>>> from segno import helpers | ||
>>> qr = helpers.make_vcard(name='Doe;John', displayname='John Doe', email='me@example.org', phone='+1234567') | ||
>>> qr.designator | ||
'5-L' | ||
>>> # Some params accept multiple values, like email, phone, url | ||
>>> qr = helpers.make_vcard(name='Doe;John', displayname='John Doe', email=('me@example.org', 'another@example.org'), url=['http://www.example.org', 'https://example.org/~joe']) | ||
>>> qr.save('my-vcard.svg') | ||
A factory function which returns the vCard as string is available as well. | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> from segno import helpers | ||
>>> vcard = helpers.make_vcard_data(name='Doe;John', displayname='John Doe', email='me@example.org', phone='+1234567') | ||
>>> vcard | ||
'BEGIN:VCARD\r\nVERSION:3.0\r\nN:Doe;John\r\nFN:John Doe\r\nEMAIL:me@example.org\r\nTEL:+1234567\r\nEND:VCARD\r\n' | ||
>>> qr = segno.make(vcard, error='H') | ||
>>> qr.designator | ||
'9-H' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
EPC QR Codes | ||
============ | ||
|
||
European Payments Council Quick Response Code (EPC QR Codes) are used to | ||
initiate SEPA credit transfers. They encode all necessary data (IBAN, amount, | ||
recipient) and may be placed on invoices to eliminate the error-prone typing | ||
of payment Information. | ||
|
||
See the `EPC guidelines (PDF document) <https://www.europeanpaymentscouncil.eu/sites/default/files/KB/files/EPC069-12%20v2.1%20Quick%20Response%20Code%20-%20Guidelines%20to%20Enable%20the%20Data%20Capture%20for%20the%20Initiation%20of%20a%20SCT.pdf>`_ | ||
for more information. | ||
|
||
The function :py:func:`segno.helpers.make_epc_qr` is used to create a EPC QR Code. | ||
It is not possible to modify the error correction level or to change the version | ||
of the QR Code. The EPC guidelines specify that the error correction level is | ||
fixed to "M" and the QR Code version must not be higher than 13. | ||
|
||
.. code-block:: python | ||
>>> from segno import helpers | ||
>>> qr = helpers.make_epc_qr(name='Wikimedia Foerdergesellschaft', iban='DE33100205000001194700', amount=20, text='Spende fuer Wikipedia') | ||
>>> qr.save('spende-wikipedia.png', scale=3) | ||
.. image:: _static/spende-wikipedia.png | ||
:alt: EPC QR Code | ||
|
||
The QR Code shown above encodes the following information:: | ||
|
||
BCD | ||
002 | ||
2 | ||
SCT | ||
|
||
Wikimedia Foerdergesellschaft | ||
DE33100205000001194700 | ||
EUR20 | ||
|
||
By default, the function uses the minimal possible encoding to encode the | ||
provided data. If another encoding, i.e. UTF-8, is required, the user may specify | ||
the encoding with an integer referring to one of the supported encodings | ||
(1: UTF-8, 2: ISO 8859-1, 3: ISO 8859-2, 4: ISO 8859-4, 5: ISO 8859-5, | ||
6: ISO 8859-7, 7: ISO 8859-10, 8: ISO 8859-15) | ||
|
||
|
||
.. code-block:: python | ||
>>> from segno import helpers | ||
>>> qr = helpers.make_epc_qr(name='Wikimedia Foerdergesellschaft', iban='DE33100205000001194700', amount=13.05, text='Spende fuer Wikipedia', encoding=1) | ||
>>> qr.save('spende-wikipedia2.png', scale=3) | ||
.. image:: _static/spende-wikipedia2.png | ||
:alt: EPC QR Code | ||
|
||
Decoded infomation:: | ||
|
||
BCD | ||
002 | ||
1 | ||
SCT | ||
|
||
Wikimedia Foerdergesellschaft | ||
DE33100205000001194700 | ||
EUR13.05 | ||
|
||
|
||
Spende fuer Wikipedia | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.