Csv Editor

CSV Editor App

This project is a web-based CSV editor built using FastHTML, HTMX, and SQLite.

Key Technologies and Techniques

  1. FastHTML: A Python-based framework for building web applications with a focus on web fundamentals.
  2. HTMX: Used to create dynamic server-side content updates that let you interact with the app without page reloads.
  3. SQLite: A lightweight, serverless database used to store and manage CSV data.
  4. FastSQL: A library that simplifies database operations and integrates well with FastHTML.
  5. httpx: An asynchronous HTTP client for Python, used to fetch example CSV data.

How It Works

Server-Side Logic

The app uses FastHTML to define routes and handle CSV operations. Key routes include:

Data Management

CSV data is stored in an SQLite database:

Dynamic Content

HTMX is used to create a dynamic user interface:

Key Features

  1. CSV Upload: Users can upload CSV files to view and edit the data.
  2. Example CSV: An example CSV file is provided for download.
  3. Data Display: Uploaded CSV data is displayed in an editable table format.
  4. Row Editing: Each row can be updated or deleted individually.
  5. Data Download: The current state of the CSV data can be downloaded at any time.
  6. Session Management: Each user session has its own unique data storage.
  7. File Size Limit: Only the first 50 rows of a CSV file are processed and displayed.

This CSV Editor app demonstrates how FastHTML and HTMX can be combined to create a responsive, server-side web application for data manipulation tasks.