Skip to main content

A simple QR code generator using a free API

Project description

GetMyQR

A simple Python package to generate QR codes using a free API.

Installation

You can install the package using pip:

pip install getmyqr

Usage

You can use the QR code generator in your Python script or from the command line.

Example 1: Python Script

Generate a QR code with default size and high quality:

from getmyqr import generate_qr_code

output_file = generate_qr_code("Hello, world!", "hello_world_default.png")

if "Error" not in output_file:
    print(f"QR code saved to: {output_file}")
else:
    print(output_file)

Generate a QR code with custom size and quality:

output_file_custom = generate_qr_code("Custom QR code", "custom_qr_medium.png", size="400x400", quality="M")

if "Error" not in output_file_custom:
    print(f"QR code saved to: {output_file_custom}")
else:
    print(output_file_custom)

Generate a QR code with low quality:

output_file_low = generate_qr_code("Low quality QR code", "low_quality_qr.png", size="500x500", quality="L")

if "Error" not in output_file_low:
    print(f"QR code saved to: {output_file_low}")
else:
    print(output_file_low)

Example 2: Command Line

To generate a QR code from the command line, use the following command:

getmyqr "Hello, world!" --output "hello_world_qr.png"

To generate a QR code with custom size and quality:

getmyqr "Hello, world!" --output "hello_world_qr_custom.png" --size "400x400" --quality "Q"

Parameters

  • --size: Customizes the size of the QR code. Example: 400x400 (default is 300x300).
  • --quality: Customizes the error correction level. Options: L (low), M (medium), Q (quartile), H (high). Default is H.
  • --output: The name of the output file. Default is qrcode.png.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

getmyqr-1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

getmyqr-1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file getmyqr-1.0.tar.gz.

File metadata

  • Download URL: getmyqr-1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for getmyqr-1.0.tar.gz
Algorithm Hash digest
SHA256 a49f37e8be5b4e8910c6e7252225aabc124432635fe16a44878b4897cd793e98
MD5 403d5134736521e31fa6318e7880bd73
BLAKE2b-256 1339abdb24ef189580d4ba12783269070ff487951b8eab99a7e06337acf2735c

See more details on using hashes here.

File details

Details for the file getmyqr-1.0-py3-none-any.whl.

File metadata

  • Download URL: getmyqr-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for getmyqr-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21da3e86c862e336af2bc9b357cd2080776ef175df63e8882c40fcb9c57f18e0
MD5 e51c6089738042a036a7fd46e3a4a971
BLAKE2b-256 b63cee116203171b03f658e868208d9d287d9506d1ace5dc02a56869d9366c99

See more details on using hashes here.

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