qrpipe
qrpipe turns piped input into a QR code or QR image.
The smallest useful interaction is:
printf '%s' 'https://example.com' | qrpipe
By default, qrpipe renders a compact QR code in the terminal. With --output, it writes a
file whose format is inferred from the extension by Segno.
Install for development
python3.12 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'
.venv/bin/qrpipe --help
Examples
printf '%s' 'https://example.com' | qrpipe
echo 'https://example.com' | qrpipe
cat payload.txt | qrpipe
qrpipe 'https://example.com'
printf '%s' 'https://example.com' | qrpipe --output example.png --size 8
printf '%s' 'https://example.com' | qrpipe -o example.svg --size 4
printf '%s' 'https://example.com' | qrpipe -o example.png --open
printf '%s' 'important payload' | qrpipe --redundancy H
--size controls the output module scale; --scale is an alias. --redundancy (also
--error) selects the exact QR error-correction level: L, M, Q, or H. --open is an
explicit opt-in that opens an image file with the operating system's default viewer; it requires
--output.
Structured payloads
The default --type text leaves the payload unchanged. --type phone converts a human-readable
number into a tel: URI:
printf '%s\n' '+1 (555) 010-1234' | qrpipe --type phone -o phone.png
--type vcard accepts a complete vCard, common property lines (FN:, TEL:, EMAIL:, ORG:),
or a plain name, which becomes a minimal vCard:
printf '%s' 'Ada Lovelace' | qrpipe --type vcard -o ada.svg
printf '%s\n' 'FN:Ada Lovelace' 'EMAIL:ada@example.test' | qrpipe --type vcard -o ada.svg
Structured payloads must be UTF-8. Ordinary text input is read as bytes and passed to Segno without a decode/re-encode round trip.
Input and output semantics
- A positional
DATAvalue takes precedence over standard input and is treated literally. - When reading standard input, exactly one final
\nor\r\nis removed by default. Use--preserve-newlinewhen that line ending is meaningful payload data. - Empty input exits with status
2; whitespace is valid data. - Running
qrpipewith no argument on an interactive terminal exits immediately with guidance instead of waiting forever for EOF. - File output is written beside the destination and atomically replaces an existing destination.
- PNG and SVG are the normal file formats; Segno also supports other formats selected by extension.
Successful terminal output contains only the QR rendering. Diagnostics never include the original payload, which matters for URLs with tokens, Wi-Fi credentials, OTP setup URIs, and other secrets.
Deliberate boundaries
qrpipe always creates ordinary QR codes. Micro QR, structured-append sequences, explicit Segno encoding modes, and additional helper formats such as Wi-Fi, email, geo, MeCard, and EPC payment QR are intentionally outside this small initial interface.
Development
.venv/bin/python -m scripts.ci
This runs compilation, Ruff, branch coverage, build/metadata checks, Pyright, Markdown linting, and pre-commit. GitHub Actions runs the same gates on Ubuntu, macOS, and Windows with Python 3.12, 3.13, and 3.14.
Releasing
- Push the release commit and wait for CI to pass.
- Configure PyPI and TestPyPI trusted publishers for this repository's corresponding workflows.
- Tag that commit as
v0.1.0and push the tag. - Run Publish to TestPyPI from GitHub Actions against the tag and install the result in a fresh environment.
- Create a GitHub release from the same tag to publish to PyPI.
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qrpipe-0.1.0.tar.gz.
File metadata
- Download URL: qrpipe-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af109f16586e789c4cc6442ad430bdd2464bc6cbd66ea9daea3bae562a7412ba
|
|
| MD5 |
4d7f2a509717ed40e342b6e33a123d51
|
|
| BLAKE2b-256 |
02b4becebdd5414f02a56b21bb589e32b145167541a3a63a4f6f4e3135ae6e5a
|
File details
Details for the file qrpipe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qrpipe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7641ce97d4704e87f105de4f23f00f8f025c36fdb783925298846c5dc08b2ec
|
|
| MD5 |
b874909582852e35dab1f37e935b74a3
|
|
| BLAKE2b-256 |
eb67fe9265f7951535554f89167b9071554442a9c58a472bfebe441d8d215047
|