Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Aug 17, 2016
2 parents 2f50534 + e13f173 commit ef5a801
Show file tree
Hide file tree
Showing 20 changed files with 548 additions and 317 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.coverage
.tox
.idea
segno/*.egg-info
*.egg-info
tests/htmlcov/*
tests/output/*
dist/
build/
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changes
=======

0.1.2 -- 2016-08-17
-------------------
* Updated docs
* Backwards incompatible change: Deprecated "eps", "svg", "png", "pdf", and
"txt" methods from QRCode. Use QRCode.save.
Methods will be removed in 0.1.3
* Fixed issue #3 (M1 and M3 codes may have undefined areas)
* Fixed issue #4 (wrong 'error' default value for encoder.encode(),
factory function segno.make() wasn't affected)


0.1.1 -- 2016-08-14
-------------------
* Initial release
17 changes: 17 additions & 0 deletions docs/colors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Colors
======

Almost all serializers support custom settings for the color of the dark modules
and the background (light modules) of a (Micro) QR Code.

The color values can be provides as tuple (``(R, G, B)``), as web color name
(like 'red') or as hexadecimal ``#RRGGBB`` value (i.e. '#085A75'). If alpha
transparency is supported (i.e. PNG and SVG), hexadecimal values like
``#RRGGBBAA`` are accepted.

The color values are automatically converted into a meaningful value of the
specific output format (note that providing an alpha channel to a serializer
which does not accept an alpha channel results into an error).



6 changes: 3 additions & 3 deletions docs/comparison-qrcode-libs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Features
Description `qrcode`_ `PyQRCode`_ `qrcodegen`_ `Segno`_
============================================ ================== =================== ================== ========
Library license `BSD`_ `BSD`_ `MIT`_ `BSD`_
Library version 5.3 1.2.1 1.0.0 0.1.0
Library version 5.3 1.2.1 1.0.0 0.1.2
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 Kanji No Yes No Yes
Mode ECI No No Yes Yes
Mode FNC1 No No No No
Mode Structured Append No No No No
Expand All @@ -37,7 +37,7 @@ Command line script Yes No
Plugins No No No Yes
Default encoding in Byte mode UTF-8 ISO/IEC 8859-1 UTF-8 ISO/IEC 8859-1
or UTF-8 or UTF-8
3rd party depencencies `six`_, `PyPNG`_ - -
3rd party dependencies `six`_, `PyPNG`_ - -
`Pillow`_ or
`Pymaging`_ and
`Pymaging-PNG`_
Expand Down
9 changes: 1 addition & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ Segno generates QR Codes and Micro QR Codes according to ``ISO/IEC 18004:2015(E)
Aside from other Pyhton QR Code generators, Segno has no 3rd party dependencies
and is very simple to use.

If you know the (great) API of Michael Nooner's `PyQRCode`_ library, you'll
discover some similarities since this project started accidentally as an
improvment of PyQRCode, even if this project is not a fork of it.


Contents:

.. toctree::
:maxdepth: 4

make
colors
serializers
comparison-qrcode-libs
replace-qrcode-libs
Expand All @@ -28,6 +24,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


.. _PyQRCode: https://github.com/mnooner256/pyqrcode
2 changes: 1 addition & 1 deletion docs/replace-qrcode-libs.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Replace existing QR Code libs with Segno
========================================

The sub-project `Segno Mimos`_ provides a APIs which are usable to replace
The sub-project `Segno Mimos`_ provides APIs which are usable to replace
common Python QR Code libs like `PyQRCode`_ and `qrcode`_ with Segno.


Expand Down
24 changes: 12 additions & 12 deletions docs/serializers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ a custom border, you may specify the border
Most serializers accept a ``scale`` parameter which indicates the scaling
factor of the serialization. By default, the scale is ``1`` which means that
the dark / light modules of a (Micro) QR Code is interpreted as 1 unit in the
specific user space (i.e. 1 pixel for the PNG serializer or 1 point (1/72 of an
inch) in EPS). Some serializers (like PNG) accept only an integer value or
convert the provided scaling factor to an integer. Other, like SVG and EPS
accept float values and do not "downgrade" it to integer.
factor of the serialization. By default, the scaling factor is ``1`` which means
that the dark / light modules of a (Micro) QR Code is interpreted as 1 unit in
the specific user space (i.e. 1 pixel for the PNG serializer or 1 point (1/72 of
an inch) in EPS). Some serializers (like PNG) accept only an integer value or
convert the provided scaling factor to an integer. Other, like SVG and EPS,
accept float values and do not "downgrade" it to an integer.

.. code-block:: python
Expand All @@ -60,10 +60,8 @@ accept float values and do not "downgrade" it to integer.
Many serializers accept the parameters ``color`` and ``background`` to specify
the color of the dark modules and light modules (background). If accepted,
``None`` is interpreted as "transparent". Colors may be specified as HTML color
names, as hexadecimal value (``#RGB`` or ``#RRGGBB``), or (if supported) as
hexadecimal value with an alpha channel (``#RGBA`` or ``#RRGGBBAA``).
the color of the dark modules and light modules (background). See :doc:`colors`
for details.

.. code-block:: python
Expand All @@ -75,9 +73,11 @@ hexadecimal value with an alpha channel (``#RGBA`` or ``#RRGGBBAA``).
>>> # Dark modules = transparent, light modules = black
>>> qr.save('neil-young-3.png', color=None, background='black')
>>> # Dark modules with alpha transparency
>>> qr.save('neil-young-4.png', color='#0000ffcc', background=None)
>>> qr.save('neil-young-4.png', color='#0000ffcc')
>>> qr.save('neil-young-4.svg', color='#00fc') # Same as above but SVG
>>> # Anonther color, save as compressed SVG
>>> qr.save('neil-young-5.svgz', color=(8, 90, 117))
See :py:class:`segno.QRCode` for a complete reference which parameters are
See :py:meth:`segno.QRCode.save` for a complete reference which parameters are
accepted by the specific serializers.

0 comments on commit ef5a801

Please sign in to comment.