“This Python script allows you to generate multiple QR codes in bulk directly from an Excel file. By reading data from a specific column, the program automatically creates QR codes for each entry—perfect for tasks like inventory management, event ticketing, business cards, or marketing campaigns. The generated QR codes are saved as image files in a designated folder for easy access and distribution.”
Bulk QR Code Generator for Excel Data Using Python
Automate QR code creation for multiple data entries stored in Excel. This guide walks you through importing data from an Excel file and generating QR codes for each entry, perfect for inventory management, event passes, or bulk marketing
Python Code to Generate Bulk QR Codes from Excel
Step 1: Install Required Libraries
pip install pandas openpyxl qrcode
- pandas for reading Excel files
- openpyxl to support .xlsx files
- qrcode to generate QR codes
Step 2: Python Code
import pandas as pd import qrcode import os # Function to generate QR codes from Excel data def generate_bulk_qr(excel_file, column_name, output_folder='QR_Codes'): # Read the Excel file data = pd.read_excel(excel_file) # Create output folder if it doesn't exist if not os.path.exists(output_folder): os.makedirs(output_folder) # Loop through each entry in the specified column for index, value in enumerate(data[column_name]): # Generate QR code qr = qrcode.make(str(value)) # Save QR code with a unique name qr_filename = f"{output_folder}/QRCode_{index + 1}.png" qr.save(qr_filename) print(f"Generated QR Code for: {value}") print(f"All QR codes saved in '{output_folder}' folder.") # Example usage excel_file = 'data.xlsx' # Replace with your Excel file name column_name = 'Website' # Replace with the column name you want to convert to QR codes generate_bulk_qr(excel_file, column_name)
Step 3: Excel File Format (data.xlsx)
Name | Website |
---|
https://www.google.com |
OpenAI | https://www.openai.com |
GitHub | https://www.github.com |
- Make sure the Website column exists in your Excel file.
- The script will create QR codes for each link in the column
Output:
The QR codes will be saved in a folder named QR_Codes.