The Label Maker is a Python-based application designed to generate styled PDF labels from an Excel file. It uses the ReportLab library for PDF generation and provides a graphical user interface (GUI) for ease of use. The application supports adding logos, cursive titles, and other customizations to the labels.
- Generates 4x8 styled labels per page.
- Reads data from an Excel file, treating the second row as the header.
- Supports adding logos from a specified folder (
logos/). - Automatically opens the generated PDF after creation.
- Customizable fonts, sizes, and layout.
- Python 3.7 or higher
- Required Python libraries:
pandastkinterreportlabPillow
- Clone or download this repository.
- Install the required Python libraries using pip:
pip install pandas pillow reportlab
- Place your Excel file in the same directory as the script or browse to it using the GUI.
- Ensure the Excel file has the following structure:
- The first row contains a special value (e.g., a title for the labels).
- The second row contains the column headers.
- Columns should include:
#(Product Code)Nombre(Product Name)Lugar(Size or Location)
- Place logo images in the
logos/folder. The filenames should match the product names in the Excel file (case-insensitive, spaces ignored). - Run the script:
python label_maker.py
- Use the GUI to select the Excel file and generate the labels.
- The generated PDF will open automatically and be saved in the same directory as the script.
- Excel File Structure:
- The first row is treated as a special value (e.g., title).
- The second row is used as the header.
- Label Layout:
- 4 columns and 8 rows per page.
- Margins: 0.05 inches.
- Internal label margin: 0.12 inches.
- Fonts:
- Product Code:
Times-Bold, size 12. - Product Name:
Helvetica, size 14. - Cursive Title:
Times-Italic, size 16.8 (calculated as 1.2x the name font size). - Size/Location:
Helvetica-Bold, size 12.
- Product Code:
- Image Dimensions:
- Logo width: 1.2 inches.
- Logo height: calculated based on aspect ratio.
- Border image height: 0.15 inches.
label_maker.py: Main script.logos/: Folder containing logo images.Border.PNG: Image used for top and bottom borders of labels.build/: Folder generated by PyInstaller (if used to create an executable).
- If the
logos/folder is missing, it will be created automatically. - If a matching logo is not found, the title will be displayed in a cursive font instead.
- The application is designed for Windows but can be adapted for other operating systems.
- Error: Missing Dependencies: Ensure all required libraries are installed.
- Error: Missing Files: Verify that the Excel file and
Border.PNGare in the correct locations. - Error: Invalid Excel File: Ensure the file follows the required structure.
This project is licensed under the MIT License.