Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Sales Report Generator

Python Version Dependency License

A Python automation tool that transforms raw Excel sales data into a structured sales analysis report.

The program reads sales spreadsheets, validates required columns, calculates key business metrics, analyzes revenue performance, and generates a formatted Excel report automatically.


🖥️ Demo

Sales Data ➜ Automated Analysis ➜ Generated Report

Raw sales spreadsheet Sales analysis process

Generated sales report


🎯 Problem

Sales reports often require repetitive manual work:

  • Calculating total revenue
  • Finding top-performing products
  • Comparing category performance
  • Preparing formatted summaries

Performing these tasks manually can be time-consuming and prone to errors.


✅ Solution

This tool automates Excel sales analysis by:

  • Reading sales data directly from Excel workbooks
  • Validating required columns before processing
  • Calculating important sales metrics
  • Generating a dedicated report worksheet
  • Applying professional formatting automatically

The original workbook is preserved, and the generated report is saved as a new Excel file.


⚡ Core Features

  • 📂 Excel Workbook Processing
    Loads existing Excel files and allows users to select the worksheet they want to analyze.

  • 🔎 Automatic Column Detection
    Identifies required fields such as Product, Category, Price, and Units.

  • Data Validation
    Checks for missing columns and invalid sales data before generating the report.

  • 💰 Revenue Analysis
    Calculates total revenue based on product prices and units sold.

  • 📦 Product Performance Analysis
    Identifies:

    • Best-selling product by units sold
    • Highest revenue product
  • 🗂️ Category Revenue Analysis
    Calculates revenue contribution by category and identifies the highest-performing category.

  • 📊 Automated Report Generation
    Creates a dedicated "Sales Report" worksheet containing:

    • Total revenue
    • Total units sold
    • Best-selling product
    • Highest revenue product
    • Highest revenue category
    • Average product price
    • Revenue breakdown by category
  • 🎨 Report Formatting
    Applies headers, alignment, borders, column sizing, and currency formatting for improved readability.


🛠️ Tech Stack

  • Language: Python 3.x
  • Spreadsheet Processing: openpyxl
  • File Handling: pathlib
  • System Utilities: sys

🚀 Quick Start

1. Clone the repository

git clone https://github.com/DevBlueprintLab/sales-report-generator.git

cd sales-report-generator

2. Install dependencies

pip install -r requirements.txt

3. Run the generator

python sales_report_generator.py

4. Select your Excel file and worksheet

Example:

===================================
Sales Report Generator
===================================

Enter excel file path:
sample_data/sales_data.xlsx

Available sheets:
['Sales']

choose sheet:
>Sales

5. Generated output

The report will automatically be saved inside:

Reports/

Example:

Reports/
└── sales_data_report.xlsx

📁 Project Structure

sales-report-generator/

├── sales_report_generator.py       # Main automation script
├── README.md                       # Project documentation
├── requirements.txt                # Project dependencies
├── sample_data/
│   └── sales_data.xlsx             # Example sales dataset
└── images/
    ├── sales-input.png             # Original sales spreadsheet
    ├── analysis-process.png        # Terminal analysis process
    └── generated-report.png        # Generated Excel report

🔄 Workflow

Excel Sales File
        |
        ↓
Load Workbook
        |
        ↓
Select Worksheet
        |
        ↓
Validate Required Columns
        |
        ↓
Calculate Sales Metrics
        |
        ↓
Generate Report Worksheet
        |
        ↓
Format & Save Excel Report

💼 Practical Use Cases

Useful for:

  • Small business sales reporting
  • Retail performance analysis
  • Monthly sales summaries
  • Automated Excel reporting workflows
  • Reducing repetitive spreadsheet calculations

🔮 Future Improvements

  • Add charts and visual dashboards
  • Support CSV input files
  • Add date-based sales analysis
  • Export reports to PDF
  • Add automated email delivery

📜 License

This project is licensed under the MIT License.


Developed by DevBlueprintLab

About

A Python automation tool that analyzes Excel sales data and generates formatted business reports automatically.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages