Skip to content

Commit

Permalink
Removed PyQRCode from comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Jan 4, 2022
1 parent 5c213c9 commit 196c93c
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 124 deletions.
6 changes: 3 additions & 3 deletions docs/_static/chart_create_1m.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_create_30h.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_create_7q.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_png.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_svg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 55 additions & 49 deletions docs/comparison-qrcode-libs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,63 @@ Features
.. table::
:class: pylib-comparison

================================================================ ===================== =================== ====================== ========
Description `qrcode`_ `PyQRCode`_ `qrcodegen`_ `Segno`_
================================================================ ===================== =================== ====================== ========
Library license `BSD`_ `BSD`_ `MIT`_ `BSD`_
Library version 7.3.1 1.2.1 1.7.0 |version|
Mode Numeric Yes Yes Yes Yes
Mode Alphanumeric Yes Yes Yes Yes
Mode Byte Yes Yes Yes Yes
Mode Kanji No Yes Yes Yes
Mode ECI No No Yes Yes
Mode FNC1 No No No No
Mode Structured Append No No No Yes
Mode Hanzi [1]_ No No No Yes
Mixing modes Yes No Yes Yes
QR Codes version 1 - 40 Yes Yes Yes Yes
Micro QR Codes version M1 - M4 No No No Yes
Output acc. to ISO/IEC 18004:2015(E) Fig. 1 [2]_ |br| |ISO 1-M| No |br| |qrcode 1-M| No |br| |pyqr 1-M| No |br| |qrcode 1-M| Yes |br| |segno 1-M|
Output acc. to ISO/IEC 18004:2015(E) Fig. 2 |br| |ISO M2-L| - - - Yes |br| |segno M2-L|
Find maximal error correction level No No Yes Yes
Optimize QR Codes Yes No No No
`PNG`_ output Yes Yes No Yes
`SVG`_ output Yes Yes No Yes
`EPS`_ output Yes Yes No Yes
`PDF`_ output Yes No No Yes
`PAM`_ output No No No Yes
`PBM`_ output Yes No No Yes
`PPM`_ output Yes No No Yes
`LaTeX`_ support No No No Yes
`XBM`_ output Yes Yes No Yes
`XPM`_ output No No No Yes
PNG `data URI`_ No No (no valid URI) No Yes
SVG data URI No No No Yes
Text output Yes Yes No Yes
`ANSI`_ escape code output Yes Yes No Yes
Other output formats (i.e. `JPEG`_) Yes No No Yes via `plugin`_
Black and white QR Codes Yes Yes Yes Yes
Colored QR Codes Yes Yes No Yes
Animated QR Codes (`GIF`_, `APNG`_, `WebP`_) No No No Yes via `plugin`_
Changing size of modules (scaling factor) Yes Yes No Yes
Command line script Yes No No Yes
Plugins No No No Yes
Default encoding in Byte mode ISO/IEC 8859-1 ISO/IEC 8859-1 ISO/IEC 8859-1 ISO/IEC 8859-1
or UTF-8 or UTF-8 or UTF-8 or UTF-8
3rd party dependencies `Pillow`_ or `PyPNG`_ - -
================================================================ ===================== ====================== ========
Description `qrcode`_ `qrcodegen`_ `Segno`_
================================================================ ===================== ====================== ========
Library license `BSD`_ `MIT`_ `BSD`_
Library version 7.3.1 1.7.0 |version|
Mode Numeric Yes Yes Yes
Mode Alphanumeric Yes Yes Yes
Mode Byte Yes Yes Yes
Mode Kanji No Yes Yes
Mode ECI No Yes Yes
Mode FNC1 No No No
Mode Structured Append No No Yes
Mode Hanzi [1]_ No No Yes
Mixing modes Yes Yes Yes
QR Codes version 1 - 40 Yes Yes Yes
Micro QR Codes version M1 - M4 No No Yes
Output acc. to ISO/IEC 18004:2015(E) Fig. 1 [2]_ |br| |ISO 1-M| No |br| |qrcode 1-M| No |br| |qrcode 1-M| Yes |br| |segno 1-M|
Output acc. to ISO/IEC 18004:2015(E) Fig. 2 |br| |ISO M2-L| - - Yes |br| |segno M2-L|
Find maximal error correction level No Yes Yes
Optimize QR Codes Yes No No
`PNG`_ output Yes No Yes
`SVG`_ output Yes No Yes
`EPS`_ output Yes No Yes
`PDF`_ output Yes No Yes
`PAM`_ output No No Yes
`PBM`_ output Yes No Yes
`PPM`_ output Yes No Yes
`LaTeX`_ support No No Yes
`XBM`_ output Yes No Yes
`XPM`_ output No No Yes
PNG `data URI`_ No No Yes
SVG data URI No No Yes
Text output Yes No Yes
`ANSI`_ escape code output Yes No Yes
Other output formats (i.e. `JPEG`_) Yes No Yes via `plugin`_
Black and white QR Codes Yes Yes Yes
Colored QR Codes Yes No Yes
Animated QR Codes (`GIF`_, `APNG`_, `WebP`_) No No Yes via `plugin`_
Changing size of modules (scaling factor) Yes No Yes
Command line script Yes No Yes
Plugins No No Yes
Default encoding in Byte mode ISO/IEC 8859-1 ISO/IEC 8859-1 ISO/IEC 8859-1
or UTF-8 or UTF-8 or UTF-8
3rd party dependencies `Pillow`_ or - -
`Pymaging`_ and
`Pymaging-PNG`_
(Windows:
`colorama`_)
================================================================ ===================== =================== ====================== ========
================================================================ ===================== ====================== ========

.. [1] The Hanzi mode is not part of ISO/IEC 18004 and may not be supported by all QR Code decoders.
Segno uses the Hanzi mode if the user enables it explicitly, see :ref:`hanzi-mode` for details
.. [2] Even if all libs generate the same byte output (``40 e5 15 22 04 36 f6 46 52 05 37 96 d6 26 f6 c0``),
the generated QR code may look different because they choose a different mask pattern.
ISO/IEC 18004:2015(E) (cf. page 7) uses mask 5, while qrcode and qrcodegen use mask 4 and
PyQRCode uses mask 6. All these QR codes can be read by common QR Code readers.
ISO/IEC 18004:2015(E) (cf. page 7) uses mask 5, while qrcode and qrcodegen use mask 4.
All these QR codes can be read by common QR Code readers.
Performance
Expand Down Expand Up @@ -155,9 +155,15 @@ Create a QR code 1-M "QR Code Symbol" and serialize it as PNG image.
:height: 52


The comparison included PyQRCode in all years before 2022. In the meantime, six
years have passed without any updates and PyQRCode has lost its connection in
many aspects.

Although popular, it lost all feature and performance comparisons, therefore it
is no longer part of this comparison.


.. _qrcode: https://pypi.org/project/qrcode/
.. _PyQRCode: https://pypi.org/project/PyQRCode/
.. _PyQRCodeNG: https://pypi.org/project/PyQRCodeNG/
.. _qrcodegen: https://pypi.org/project/qrcodegen/
.. _Segno: https://pypi.org/project/segno/
.. _BSD: http://opensource.org/licenses/BSD-3-Clause
Expand Down
46 changes: 5 additions & 41 deletions sandbox/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
qrcodegen_error_h = QrCode.Ecc.HIGH
except ImportError:
qrcodegen = None
try:
import pyqrcode
except ImportError:
pyqrcode = None

if qrcode:
def create_qrcode(data='QR Code Symbol'):
Expand Down Expand Up @@ -67,28 +63,6 @@ def png_qrcode(data='QR Code Symbol'):
qr.add_data(data, optimize=False)
qr.make_image().save(os.path.join(_output_dir(), 'qrcode_%s.png' % data))


if pyqrcode:
def create_pyqrcode(data='QR Code Symbol'):
"""PyQRCode create 1-M"""
pyqrcode.create(data, error='m')

def create7q_pyqrcode(data='QR Code Symbol'):
"""PyQRCode create 7-Q"""
pyqrcode.create(data, error='q', version=7)

def create30h_pyqrcode(data='QR Code Symbol'):
"""PyQRCode create 30-H"""
pyqrcode.create(data, error='h', version=30)

def svg_pyqrcode(data='QR Code Symbol'):
"""PyQRCode SVG"""
pyqrcode.create(data, error='m').svg(os.path.join(_output_dir(), 'pyqrcode_%s.svg' % data), scale=10)

def png_pyqrcode(data='QR Code Symbol'):
"""PyQRCode PNG 1-M"""
pyqrcode.create(data, error='m').png(os.path.join(_output_dir(), 'pyqrcode_%s.png' % data), scale=10)

if qrcodegen:
def create_qrcodegen(data='QR Code Symbol'):
"""qrcodegen create 1-M"""
Expand Down Expand Up @@ -143,9 +117,7 @@ def png_segno(data='QR Code Symbol'):


def run_create_tests(which=None, number=200, table=None):
tests = ('create_pyqrcode',
'create_pyqrcodeng',
'create_qrcodegen',
tests = ('create_qrcodegen',
'create_qrcode',
'create_segno',)
if which:
Expand All @@ -154,9 +126,7 @@ def run_create_tests(which=None, number=200, table=None):


def run_create7q_tests(which=None, number=200, table=None):
tests = ('create7q_pyqrcode',
'create7q_pyqrcodeng',
'create7q_qrcodegen',
tests = ('create7q_qrcodegen',
'create7q_qrcode',
'create7q_segno',)
if which:
Expand All @@ -165,9 +135,7 @@ def run_create7q_tests(which=None, number=200, table=None):


def run_create30h_tests(which=None, number=200, table=None):
tests = ('create30h_pyqrcode',
'create30h_pyqrcodeng',
'create30h_qrcodegen',
tests = ('create30h_qrcodegen',
'create30h_qrcode',
'create30h_segno',)
if which:
Expand All @@ -176,9 +144,7 @@ def run_create30h_tests(which=None, number=200, table=None):


def run_svg_tests(which=None, number=200, table=None):
tests = ('svg_pyqrcode',
'svg_pyqrcodeng',
'svg_qrcode_path', 'svg_qrcode_rects',
tests = ('svg_qrcode_path', 'svg_qrcode_rects',
'svg_segno',)

if which:
Expand All @@ -187,9 +153,7 @@ def run_svg_tests(which=None, number=200, table=None):


def run_png_tests(which=None, number=200, table=None):
tests = ('png_pyqrcode',
'png_pyqrcodeng',
'png_qrcode',
tests = ('png_qrcode',
'png_segno',)
if which:
tests = filter(lambda n: n[len('png_'):] in which, tests)
Expand Down
33 changes: 14 additions & 19 deletions sandbox/out/results.csv
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
PyQRCode create 1-M,6.00
qrcodegen create 1-M,4.17
qrcode create 1-M,2.18
Segno create 1-M,1.52
PyQRCode create 7-Q,27.62
qrcodegen create 7-Q,18.46
qrcode create 7-Q,11.09
Segno create 7-Q,7.42
PyQRCode create 30-H,255.45
qrcodegen create 30-H,172.41
qrcode create 30-H,108.80
Segno create 30-H,71.84
PyQRCode SVG,6.16
qrcode SVG path,2.85
qrcode SVG rects,3.59
Segno SVG,1.78
PyQRCode PNG 1-M,11.57
qrcode PNG 1-M,2.89
Segno PNG 1-M,2.71
qrcodegen create 1-M,4.34
qrcode create 1-M,2.27
Segno create 1-M,1.67
qrcodegen create 7-Q,19.44
qrcode create 7-Q,11.51
Segno create 7-Q,8.12
qrcodegen create 30-H,182.71
qrcode create 30-H,113.59
Segno create 30-H,78.44
qrcode SVG path,2.93
qrcode SVG rects,3.50
Segno SVG,1.92
qrcode PNG 1-M,2.92
Segno PNG 1-M,2.83

0 comments on commit 196c93c

Please sign in to comment.