Skip to content

Convert CSV files to an HTML format for easy viewing.

Notifications You must be signed in to change notification settings

gray-area/csv_to_html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

CSV to HTML Report Generator

Overview

This Python script converts CSV files into interactive HTML reports, perfect for both technical and non-technical audiences. The generated report features:

  • Clickable URLs for easy navigation.
  • Row Deletion: Easily remove rows from the table in the browser.
  • Dark Mode: Toggle between light and dark themes for optimal viewing.
  • Sorting and Filtering: Built-in search and sort functionality using DataTables.js.

This tool is ideal for generating reports from CSV data, making them more readable and interactive. It’s especially useful when sharing data with teams, management, or anyone who needs quick access to information in a user-friendly format.


Features

  • Responsive Table: Automatically resizes and adjusts to different screen sizes.
  • DataTables Integration: Provides built-in sorting, filtering, and pagination.
  • Dark Mode Toggle: Easily switch between light and dark themes for a modern UI.
  • Row Deletion: Allow users to delete rows directly from the table (client-side).
  • Customizable: Modify and extend functionality to suit your needs.

Requirements

  • Python 3.x
  • Pandas (for reading CSV files)
  • An internet connection to fetch DataTables.js and CSS.

Installation

1. Clone the Repository

git clone https://github.com/gray-area/csv_to_html.git
cd csv-to-html-report

Install Dependencies

Ensure you have Python 3 installed, then install the necessary dependencies:

pip install pandas

Usage

Convert a CSV file to an HTML report

python csv_to_html.py <input.csv> [output.html]
  • <input.csv>: Path to your CSV file.

  • [output.html]: (Optional) The name of the output HTML file. Defaults to report.html.

Example:

python csv_to_html.py results.csv report.html

This will generate an HTML report from results.csv and save it as report.html.

Dark Mode Toggle

Once the report is opened in a browser, you can toggle between Light Mode and Dark Mode using the "🌗 Toggle Dark Mode" button at the top.

Screenshots

Here's an example of what the generated report looks like:

coming soon

Contributing

Fork the repository.

  1. Create a new branch (git checkout -b feature-name).
  2. Make your changes and commit them (git commit -am 'Add new feature').
  3. Push to your fork (git push origin feature-name).
  4. Create a new pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • DataTables for providing the awesome table functionality.
  • Pandas for making data manipulation so easy.

Customizing

You can further extend this script by:

  • Modifying the HTML template to match your company's branding.
  • Adding more interactivity (e.g., export options or advanced filters).
  • Creating a backend server (Flask/Django) to make this tool accessible as a web app.

About

Convert CSV files to an HTML format for easy viewing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages