Skip to main content

QR code generator for terminal output

Project description

qrcode_term

QR code generator for terminal output

Screenshot

From a terminal:

alt text

CLI

> python src/qrcode_term/qrcode_term.py
███████████████████████████
███▀▀▀▀▀▀▀████▀▀█▀▀▀▀▀▀▀███
███ █▀▀▀█ ██▄▀█ █ █▀▀▀█ ███
███ █   █ ███ ▀▀█ █   █ ███
███ ▀▀▀▀▀ █ █▀█▀█ ▀▀▀▀▀ ███
███▀██▀█▀▀█▀█ ▀▀▀█▀████████
███▄▄ ▄▀▄▀▀▀▄▄ ██▄ ▄▀▀▄ ███
████▄██▀▄▀   ▀▀▄▀▄▀ ▄█▄▄███
███▀▀▀▀▀▀▀█▄█▀ ▀█▀▀▀▀ ▀████
███ █▀▀▀█ █▄ ▄█▀▀█▄███▄████
███ █   █ █▄ ▀█ █▀▄ ▄ ▄ ███
███ ▀▀▀▀▀ █▀█ ▄▀▄▀▀█▀█▀████
███████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Hello world!

> python src/qrcode_term/qrcode_term.py --data "mydata" -f5
███████████████████████████████
███████████████████████████████
█████▀▀▀▀▀▀▀██▀████▀▀▀▀▀▀▀█████
█████ █▀▀▀█ █▄  █ █ █▀▀▀█ █████
█████ █   █ █▀▀▄▀▀█ █   █ █████
█████ ▀▀▀▀▀ █▀▄▀▄▀█ ▀▀▀▀▀ █████
█████▀█▀█▀█▀██▀██▀███▀██▀██████
██████ ▀▀  ▀█  █ █ ▀ █  ▀ █████
█████ ▄█▄▀▄▀ ▀█▄ ▄ ▀ ▄██▀██████
█████▀▀▀▀▀▀▀█▄▄ █▀█▄▄▀█▀  █████
█████ █▀▀▀█ █▀█ █▀█ █▀██  █████
█████ █   █ █▀█▄ █ ▀   ▀▄▀█████
█████ ▀▀▀▀▀ █▀ ▀ ▄ ▀ ▀▀█ ▀█████
███████████████████████████████
███████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
mydata

> python src/qrcode_term/qrcode_term.py --data "mydata 2" -f3 -i
                           
   ▄▄▄▄▄▄▄ ▄ ▄▄  ▄▄▄▄▄▄▄   
   █ ▄▄▄ █ ██▀█▀ █ ▄▄▄ █   
   █ ███ █ ▄▀▀▀▄ █ ███ █   
   █▄▄▄▄▄█ ▄ ▄▀█ █▄▄▄▄▄█   
   ▄  ▄▄▄▄▄▄██▀█▄  ▄ ▄▄▄   
    ▀▄▄█▀▄ ▄▀█ ▀ ▀█  ▄█▄   
   ▀▄▄ ▀▀▄▄▄▀ ▀ ▄▄▄█▄▀▀    
   ▄▄▄▄▄▄▄ █  ▀█▄▄▄█▀█▀    
   █ ▄▄▄ █ ██▀██▀▄█▀█▀ ▀   
   █ ███ █ ▀ █▀▀ ▄ ▄▀█▄▄   
   █▄▄▄▄▄█ ▄▀▄▄ ▀▀ ▄█▀▀▀   
                           
                           
mydata 2

> python src/qrcode_term/qrcode_term.py --data "mydata 3" -f10 -n
█████████████████████████████████████████
█████████████████████████████████████████
█████████████████████████████████████████
█████████████████████████████████████████
█████████████████████████████████████████
██████████ ▄▄▄▄▄ ██▄ ▀ █ ▄▄▄▄▄ ██████████
██████████ █   █ █ ▄ █▀█ █   █ ██████████
██████████ █▄▄▄█ █  ▄▄ █ █▄▄▄█ ██████████
██████████▄▄▄▄▄▄▄█ ▀▄▀ █▄▄▄▄▄▄▄██████████
██████████▄█▄▄▄▄▄█▀▄ █ █▄▄ ▄▄▀▀██████████
██████████▄ ▀  ▀▄▀█ ▄▄█▄▄ █   ███████████
██████████████▄▄▄█ █  ▀▀▀ ▀▀▀▄ ██████████
██████████ ▄▄▄▄▄ █▀▄▄▀ ▀ ▄█▀ ▄███████████
██████████ █   █ █ ▀██ ██ ▀█▀█▄██████████
██████████ █▄▄▄█ █▄▄▄▄█▄█▀█  ████████████
██████████▄▄▄▄▄▄▄█▄██▄█▄███▄█▄███████████
█████████████████████████████████████████
█████████████████████████████████████████
█████████████████████████████████████████
█████████████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
mydata 3

API

Examples:

from qrcode_term import qrcode_string

a = qrcode_string("Is there anybody out there?")
b = qrcode_string("It's just another brick in the wall", frame_width=1)
c = qrcode_string("Vera! Vera!", version=5, inverse=True, frame_width=5, ansi_white=False)

print(a)
print(b)
print(c)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qrcode_term-0.0.1.tar.gz (4.5 kB view hashes)

Uploaded source

Built Distribution

qrcode_term-0.0.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page