Skip to content

DevBlueprintLab/python-excel-to-csv-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 Excel to CSV Converter

Python Version Dependency License

A Python automation tool that converts Excel worksheets into clean CSV files while allowing users to select the desired worksheet and export data into an organized output folder.


🖥️ Demo

Excel Workbook ➜ Worksheet Selection ➜ CSV Output

Excel input file Conversion process

Generated CSV file


🎯 Problem

Excel workbooks are commonly used for storing and sharing structured data, but many systems and applications require CSV format instead.

Manually copying worksheet data into CSV files is repetitive and can introduce errors during the conversion process.


✅ Solution

This tool automates Excel-to-CSV conversion by:

  • Loading Excel workbooks
  • Allowing users to choose a worksheet
  • Exporting worksheet data into CSV format
  • Saving the converted file separately without modifying the original workbook

⚡ Core Features

  • 📊 Excel Worksheet Conversion
    Converts selected Excel worksheets into CSV files.

  • 📑 Multi-Sheet Workbook Support
    Allows users to choose which worksheet to export from workbooks containing multiple sheets.

  • Input Validation
    Checks that the provided Excel file exists before processing.

  • 🛡️ Error Handling
    Detects workbook loading issues and prevents failed conversions.

  • 📂 Organized Output Management
    Automatically creates a converted folder and saves generated CSV files separately.

  • 📈 Conversion Summary
    Displays the exported workbook name, selected worksheet, row count, and output location.


🛠️ Tech Stack

  • Language: Python 3.x
  • Excel Processing: openpyxl
  • CSV Processing: Built-in csv module
  • File Handling: pathlib

🚀 Quick Start

1. Clone the repository

git clone https://github.com/DevBlueprintLab/python-excel-to-csv-converter.git

cd python-excel-to-csv-converter

2. Install dependencies

pip install -r requirements.txt

3. Run the converter

python excel_to_csv.py

4. Select your Excel file and worksheet

Example:

========================================
CSV Converter
========================================

Enter Excel file path: sales_report.xlsx

Available sheets:['Sales', 'Employees', 'Inventory']

Choose worksheet: Sales

-------------------
 Conversion completed.
-------------------

Workbook:
sales_report.xlsx

Worksheet:
Sales

Rows exported:
25

CSV saved at:
converted/sales_report.csv

📁 Project Structure

python-excel-to-csv-converter/

├── excel_to_csv.py              # Main automation script
├── README.md                    # Project documentation
├── LICENSE                      # MIT License
├── requirements.txt             # Project dependencies
├── sample_data/
│   └── sales_report.xlsx        # Example Excel input file
└── images/
    ├── excel-input.png          # Excel workbook example
    ├── conversion-process.png   # CLI conversion process
    └── csv-output.png           # Generated CSV example

💼 Practical Use Cases

This automation tool can help with:

  • Converting Excel reports into CSV format for importing into other systems
  • Preparing spreadsheet data for analysis workflows
  • Exporting specific worksheets from large workbooks
  • Automating repetitive data transfer tasks

🔮 Future Improvements

  • Support batch conversion of multiple Excel files
  • Add CSV encoding options
  • Add automatic worksheet selection
  • Create a graphical user interface (GUI)

📜 License

This project is licensed under the MIT License.


Developed by DevBlueprintLab

About

A Python automation tool that converts Excel worksheets into CSV files with worksheet selection and organized output management.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages