Skip to main content

A simple QR code generator

Project description

QRGenerator

QRGenerator is a Python package for generating highly customizable QR codes with support for color themes, embedded logos, and more. Perfect for personal, business, or social media use cases.

Features

  • Generate QR codes for any data (URLs, text, etc.)
  • Embed a logo in the center of the QR code (with border and rounded corners)
  • Apply color themes for popular platforms (YouTube, LinkedIn, Instagram, etc.)
  • Customize QR code size, border, and finder pattern colors
  • Fully configurable via Python API
  • Lightweight and easy to use

Installation

Install via PyPI:

pip install qrstyler

Usage Example

from qrstyler import QRGenerator # Main class for creating qr codes
from qrstyler.themes import THEMES_DICT,  ThemesEnum # to get access to theme enums and related pre-set configurations
from qrstyler.generator import QRConfig # This dataclass is the input to the main method of QRGenerator

# Configure your QR code
config = QRConfig(
    version=4,  # QR code version (1-40), default to 1
    show_logo=True,  # Embed a logo
    logo_path="path_to_your_log.png",  # Custom logo (optional)
    show_theme=True,  # Use a color theme
    color_positiond_detection_corners=True,  # Color the finder patterns
    box_size=10,  # Size of each QR box (pixels), default to 10
    border=1,  # Border size (boxes), default to 1
    theme=ThemesEnum.LINKEDIN,  # Choose a theme (see below)
    custom_finder_pattern_color=None,  # Custom finder pattern color (hex or None)
    custom_theme_color=None,  # Custom QR body color (hex or None)
)

# Generate the QR code
qrgen = QRGenerator(config)
qrgen.generate_qr_code("https://www.linkedin.com/in/yourprofile", output_file="linkedin_qr.png")

QRConfig Options

Option Type Default Description
version int 1 QR code version (1-40, controls size/complexity)
show_logo bool False Whether to embed a logo in the QR code
logo_path str or None None Path to a custom logo image file
show_theme bool False Whether to apply a color theme
color_positiond_detection_corners bool False Color the finder patterns (QR corners)
box_size int 10 Size of each QR code box (pixels)
border int 1 Border size (in boxes)
theme str/enum ThemesEnum.DEFAULT Theme name or enum value
custom_finder_pattern_color str or None None Custom color for finder patterns (hex)
custom_theme_color str or None None Custom color for QR code body (hex)

ThemesEnum Values

You can use any of the following themes for quick branding and color matching. Each theme comes with a default color scheme and logo.

Enum Value Description Logo Used (placeholder) Finder Pattern Color Theme Color
ThemesEnum.YOUTUBE YouTube #FF0000 #F43D3D
ThemesEnum.LINKEDIN LinkedIn #0077B5 #0077B5
ThemesEnum.INSTAGRAM Instagram #E1306C #E1306C
ThemesEnum.FACEBOOK Facebook #1877F2 #1877F2
ThemesEnum.TWITTER X (formerly Twitter) #000000 #000000
ThemesEnum.WHATSAPP WhatsApp #25D366 #25D366
ThemesEnum.GITHUB GitHub #181717 #181717
ThemesEnum.LINKTREE Linktree #39D2B4 #39D2B4
ThemesEnum.DEFAULT Default (black/white) (No logo) #000000 #000000

Note: You can also provide your own logo via the logo_path option.

Advanced Example

from qrstyler.generator import QRConfig, QRGenerator
from qrstyler.themes import ThemesEnum

config = QRConfig(
    version=6,
    show_logo=True,
    show_theme=True,
    theme=ThemesEnum.INSTAGRAM,
    color_positiond_detection_corners=True,
    custom_finder_pattern_color="#FF00FF",
    custom_theme_color="#FFD700",
    box_size=12,
    border=4,
)
qrgen = QRGenerator(config)
qrgen.generate_qr_code("https://instagram.com/yourprofile", output_file="instagram_qr.png")

License

This project is licensed under the MIT License.

Contact

For issues or feature requests, please open an issue on GitHub.

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

qrstyler-1.1.2.tar.gz (144.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qrstyler-1.1.2-py3-none-any.whl (142.1 kB view details)

Uploaded Python 3

File details

Details for the file qrstyler-1.1.2.tar.gz.

File metadata

  • Download URL: qrstyler-1.1.2.tar.gz
  • Upload date:
  • Size: 144.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for qrstyler-1.1.2.tar.gz
Algorithm Hash digest
SHA256 061aca065e5fce3620adfd7dedb38b1d3e7b927b1606de091ea5e6afc1348257
MD5 209bcdecc35adccbe8162dcca39481bd
BLAKE2b-256 9aaca61ec53d7949983a562231e82e339aa23487b883a6687f2ad4a83aa27e3b

See more details on using hashes here.

File details

Details for the file qrstyler-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: qrstyler-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 142.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for qrstyler-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5dcd93cc446e35490a17ffd1eeecb584d36648b8fe284288d21a7ce97b1c0f1a
MD5 109719fe7df1cf87272ea50b08035b86
BLAKE2b-256 3fbce1b31a46a915960757db0b461feb161d41f88b22581feed69644b6c52620

See more details on using hashes here.

Supported by

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