Giter VIP home page Giter VIP logo

qrcodeimagetoexcel's Introduction

QR Code Extractor and Excel Workbook Creator

This program extracts QR codes from images in a specified directory and outputs the results to an Excel workbook.

How it Works

The program follows these steps:

  1. Initialize the program with the directory of images and the name of the output Excel file.
  2. Process all images in the directory with the QRCodeExtractor class.
  3. Divide the results into successful and failed extractions.
  4. Initialize the ExcelWorkbookCreator class with the successful and failed extractions and the name of the output Excel file.
  5. Create an Excel workbook with two sheets: "Successful Extractions" and "Failed Extractions".
  6. Populate the sheets with the respective extraction results.
  7. Apply styles and formatting to the workbook.
  8. Save the workbook to the output Excel file.
sequenceDiagram
    participant Main as "main.py"
    participant QRCodeExtractor as "QRCodeExtractor class"
    participant ExcelWorkbookCreator as "ExcelWorkbookCreator class"
    Main->>Main: Initialize start_time
    Main->>Main: Define image_dir, output_excel
    Main->>QRCodeExtractor: Initialize with image_dir
    QRCodeExtractor->>QRCodeExtractor: process_all_images()
    QRCodeExtractor-->>Main: Return successful_extractions, failed_extractions
    Main->>ExcelWorkbookCreator: Initialize with successful_extractions, failed_extractions, output_excel
    ExcelWorkbookCreator->>ExcelWorkbookCreator: create_workbook()
    Main->>Main: Calculate execution time
    Main->>Main: Print execution time

Sheets Design

Successful Extractions:

graph TD
    A[Header Row] --> B[Image Name]
    A --> C[URL Column]
    A --> D[Date Column]
    A --> E[Status Column]
    B --> F[Image Format: .jpg, .png, etc.]
    C --> G[Hyperlinks]
    D --> H[Date Format: DD/MM/YYYY]
    E --> I[Dropdown Menu]
    I -.-> J[Options: 'Applied', 'Approved', 'Rejected', 'Not Applicable']
    style A fill:#4472C4, color:#FFFFFF
    style B fill:#f9f9f9
    style C fill:#f9f9f9
    style D fill:#f9f9f9
    style E fill:#f9f9f9
    style F fill:#f9f9f9
    style G fill:#f9f9f9
    style H fill:#f9f9f9
    style I fill:#f9f9f9
    style J fill:#f9f9f9

Failed Extractions:

graph TD
    A[Header Row] --> B[Image Name]
    B --> C[Image Format: .jpg, .png, etc.]
    style A fill:#4472C4, color:#FFFFFF
    style B fill:#f9f9f9
    style C fill:#f9f9f9

Requirements

  • Python 3.6 or higher
  • openpyxl library for Excel workbook creation and manipulation
  • opencv-python and pyzbar libraries for QR code extraction
pip install openpyxl opencv-python pyzbar Pillow

Usage

To use this program, run the main.py script with Python 3.6 or higher.

python main.py

Acknowledgements

This code was created with the assistance of OpenAI's GPT-4 model.

qrcodeimagetoexcel's People

Stargazers

Mohamed Fayed avatar

Watchers

Mohamed Fayed avatar

Forkers

yonger318

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.