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).
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
Metadata
Release files for qr2text 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qr2text-1.1.2.tar.gz | 14.6 kB | Without provenance | Details for qr2text-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qr2text-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for qr2text-1.1.2-py3-none-any.whl |
Total release size: 22.0 kB
Release files / qr2text-1.1.2.tar.gz
| Download URL | qr2text-1.1.2.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7eb448a5f37d2eb9778888dd787ad524fb3b4b72f932394231894cf7e8baa29b
|
|
BLAKE2b-256 checksum How to use checksums |
49e10af02992e154038f5d056fe1434d3441b719e7ce9aed36bacf9b7e9133fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / qr2text-1.1.2-py3-none-any.whl
| Download URL | qr2text-1.1.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd592ef80ab41e8cbfc7dc4c3e72ec6d2fd9f2b062c881402794f7f87e8fcd40
|
|
BLAKE2b-256 checksum How to use checksums |
d02de06583e56f4dea4770f666cbb31417f288466911baa9b70f857dc7b949d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Security for qr2text 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.