qr2text


Nameqr2text JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/mgedmin/qr2text
SummaryConvert PyQRCode generated SVG to ASCII art
upload_time2024-10-09 11:18:20
maintainerNone
docs_urlNone
authorMarius Gedminas
requires_python>=3.7
licenseGPL
keywords qr svg ascii art
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            qr2text
=======

Convert SVG images containing barcodes generated by PyQRCode to ASCII art,
for displaying in a terminal.

Because I'm a weird person who reads mail using Mutt over SSH in a terminal,
and sometimes people send me QR codes for setting up TOTP authentication.

Example::

    $ python3
    >>> import pyqrcode
    >>> qr = pyqrcode.create('Hello world!')
    >>> qr.svg('hello.svg')

    $ qr2text --white-background hello.svg


        █▀▀▀▀▀█ ▀▄█▄▀▄▀▀▄ █▀▀▀▀▀█
        █ ███ █ ▀ █▄  █   █ ███ █
        █ ▀▀▀ █ ▀▀▄▄▀ ▀ ▄ █ ▀▀▀ █
        ▀▀▀▀▀▀▀ █▄█▄▀▄▀▄▀ ▀▀▀▀▀▀▀
         ▄▄▄▄▀▀ ▄▀▄▀██▀▀▀ ▀▄█▄▀ ▀
        ▀▀▀▀▀▄▀▀▄▀▄▀▄ ▀▀█▀▄ ▀█ ██
        ▄█▀▄▀ ▀▀▄  ▄██▄▀  ▀▄ █▄ ▀
        █   ▄ ▀▀▀█▄  ██▀█▀██▀█▄▀█
        ▀  ▀ ▀▀▀▄█▄▀▄█▀▀█▀▀▀███ ▄
        █▀▀▀▀▀█ ▄  █▀▄▀██ ▀ █   █
        █ ███ █  █▀▄ ▄  ▀▀█▀▀▀█▀▄
        █ ▀▀▀ █  ▄▀▀▀▀  ▀ ▄█▄█  █
        ▀▀▀▀▀▀▀  ▀ ▀▀  ▀▀ ▀ ▀   ▀


    Hello world!

Note: you may have to tell qr2text whether your terminal is black-on-white
(--white-background) or white-on-black (--black-background).  Some QR code
scanners don't care, but others will refuse to recognize inverted QR codes.

Note: for QR code decoding to work you need to have libzbar installed on your
system (e.g. ``sudo apt install libzbar0`` on Ubuntu).

.. [[[cog
..   import cog, subprocess, textwrap, os
..   os.environ['COLUMNS'] = '80'  # consistent line wrapping
..   helptext = subprocess.run(['qr2text', '--help'],
..                             capture_output=True, text=True).stdout
..   cog.outl('\nSynopsis::\n')
..   cog.outl(textwrap.indent(helptext, '    '))
..   # Run `tox -e cog-apply` to re-generate the README.
.. ]]]

Synopsis::

    usage: qr2text [-h] [--version] [--black-background] [--white-background]
                   [--big] [--trim] [--pad PAD] [--decode] [--no-decode]
                   [--encode-text ENCODE_TEXT]
                   [filename ...]

    Convert PyQRCode SVG images to ASCII art

    positional arguments:
      filename              SVG file with the QR code (use - for stdin)

    options:
      -h, --help            show this help message and exit
      --version             show program's version number and exit
      --black-background    terminal is white on black (default)
      --white-background, --invert
                            terminal is black on white
      --big                 use full unicode blocks instead of half blocks
      --trim                remove empty border
      --pad PAD             pad with empty border
      --decode              decode the QR codes (default if libzbar is available)
      --no-decode           don't decode the QR codes
      --encode-text ENCODE_TEXT
                            generate a QR code with given text

.. [[[end]]]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mgedmin/qr2text",
    "name": "qr2text",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "qr svg ascii art",
    "author": "Marius Gedminas",
    "author_email": "marius@gedmin.as",
    "download_url": "https://files.pythonhosted.org/packages/8d/59/71a6d1877b2618c37a5f7a57af57af602925376807d4eb5eb4f8acbadb42/qr2text-1.1.1.tar.gz",
    "platform": null,
    "description": "qr2text\n=======\n\nConvert SVG images containing barcodes generated by PyQRCode to ASCII art,\nfor displaying in a terminal.\n\nBecause I'm a weird person who reads mail using Mutt over SSH in a terminal,\nand sometimes people send me QR codes for setting up TOTP authentication.\n\nExample::\n\n    $ python3\n    >>> import pyqrcode\n    >>> qr = pyqrcode.create('Hello world!')\n    >>> qr.svg('hello.svg')\n\n    $ qr2text --white-background hello.svg\n\n\n        \u2588\u2580\u2580\u2580\u2580\u2580\u2588 \u2580\u2584\u2588\u2584\u2580\u2584\u2580\u2580\u2584 \u2588\u2580\u2580\u2580\u2580\u2580\u2588\n        \u2588 \u2588\u2588\u2588 \u2588 \u2580 \u2588\u2584  \u2588   \u2588 \u2588\u2588\u2588 \u2588\n        \u2588 \u2580\u2580\u2580 \u2588 \u2580\u2580\u2584\u2584\u2580 \u2580 \u2584 \u2588 \u2580\u2580\u2580 \u2588\n        \u2580\u2580\u2580\u2580\u2580\u2580\u2580 \u2588\u2584\u2588\u2584\u2580\u2584\u2580\u2584\u2580 \u2580\u2580\u2580\u2580\u2580\u2580\u2580\n         \u2584\u2584\u2584\u2584\u2580\u2580 \u2584\u2580\u2584\u2580\u2588\u2588\u2580\u2580\u2580 \u2580\u2584\u2588\u2584\u2580 \u2580\n        \u2580\u2580\u2580\u2580\u2580\u2584\u2580\u2580\u2584\u2580\u2584\u2580\u2584 \u2580\u2580\u2588\u2580\u2584 \u2580\u2588 \u2588\u2588\n        \u2584\u2588\u2580\u2584\u2580 \u2580\u2580\u2584  \u2584\u2588\u2588\u2584\u2580  \u2580\u2584 \u2588\u2584 \u2580\n        \u2588   \u2584 \u2580\u2580\u2580\u2588\u2584  \u2588\u2588\u2580\u2588\u2580\u2588\u2588\u2580\u2588\u2584\u2580\u2588\n        \u2580  \u2580 \u2580\u2580\u2580\u2584\u2588\u2584\u2580\u2584\u2588\u2580\u2580\u2588\u2580\u2580\u2580\u2588\u2588\u2588 \u2584\n        \u2588\u2580\u2580\u2580\u2580\u2580\u2588 \u2584  \u2588\u2580\u2584\u2580\u2588\u2588 \u2580 \u2588   \u2588\n        \u2588 \u2588\u2588\u2588 \u2588  \u2588\u2580\u2584 \u2584  \u2580\u2580\u2588\u2580\u2580\u2580\u2588\u2580\u2584\n        \u2588 \u2580\u2580\u2580 \u2588  \u2584\u2580\u2580\u2580\u2580  \u2580 \u2584\u2588\u2584\u2588  \u2588\n        \u2580\u2580\u2580\u2580\u2580\u2580\u2580  \u2580 \u2580\u2580  \u2580\u2580 \u2580 \u2580   \u2580\n\n\n    Hello world!\n\nNote: you may have to tell qr2text whether your terminal is black-on-white\n(--white-background) or white-on-black (--black-background).  Some QR code\nscanners don't care, but others will refuse to recognize inverted QR codes.\n\nNote: for QR code decoding to work you need to have libzbar installed on your\nsystem (e.g. ``sudo apt install libzbar0`` on Ubuntu).\n\n.. [[[cog\n..   import cog, subprocess, textwrap, os\n..   os.environ['COLUMNS'] = '80'  # consistent line wrapping\n..   helptext = subprocess.run(['qr2text', '--help'],\n..                             capture_output=True, text=True).stdout\n..   cog.outl('\\nSynopsis::\\n')\n..   cog.outl(textwrap.indent(helptext, '    '))\n..   # Run `tox -e cog-apply` to re-generate the README.\n.. ]]]\n\nSynopsis::\n\n    usage: qr2text [-h] [--version] [--black-background] [--white-background]\n                   [--big] [--trim] [--pad PAD] [--decode] [--no-decode]\n                   [--encode-text ENCODE_TEXT]\n                   [filename ...]\n\n    Convert PyQRCode SVG images to ASCII art\n\n    positional arguments:\n      filename              SVG file with the QR code (use - for stdin)\n\n    options:\n      -h, --help            show this help message and exit\n      --version             show program's version number and exit\n      --black-background    terminal is white on black (default)\n      --white-background, --invert\n                            terminal is black on white\n      --big                 use full unicode blocks instead of half blocks\n      --trim                remove empty border\n      --pad PAD             pad with empty border\n      --decode              decode the QR codes (default if libzbar is available)\n      --no-decode           don't decode the QR codes\n      --encode-text ENCODE_TEXT\n                            generate a QR code with given text\n\n.. [[[end]]]\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "Convert PyQRCode generated SVG to ASCII art",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/mgedmin/qr2text"
    },
    "split_keywords": [
        "qr",
        "svg",
        "ascii",
        "art"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfa687a17b024825f37d045868426b794e8a67a886794efff9173f1f669f9902",
                "md5": "e67d6e9b2f5862eb94402c725dcb2c58",
                "sha256": "271903d356f060012566923bbfc4bfe46c879505661025efd14adcf9fcff1d94"
            },
            "downloads": -1,
            "filename": "qr2text-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e67d6e9b2f5862eb94402c725dcb2c58",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7224,
            "upload_time": "2024-10-09T11:18:17",
            "upload_time_iso_8601": "2024-10-09T11:18:17.475580Z",
            "url": "https://files.pythonhosted.org/packages/df/a6/87a17b024825f37d045868426b794e8a67a886794efff9173f1f669f9902/qr2text-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d5971a6d1877b2618c37a5f7a57af57af602925376807d4eb5eb4f8acbadb42",
                "md5": "c89425afc14a8388e18b91082843a47f",
                "sha256": "6e1de72fa6d774f84e8007765527b255d458dcc813050469ffc9a1aa0dacc86b"
            },
            "downloads": -1,
            "filename": "qr2text-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c89425afc14a8388e18b91082843a47f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14395,
            "upload_time": "2024-10-09T11:18:20",
            "upload_time_iso_8601": "2024-10-09T11:18:20.152952Z",
            "url": "https://files.pythonhosted.org/packages/8d/59/71a6d1877b2618c37a5f7a57af57af602925376807d4eb5eb4f8acbadb42/qr2text-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 11:18:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mgedmin",
    "github_project": "qr2text",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "qr2text"
}
        
Elapsed time: 0.37410s