from utils import preview_csv

from utils import dedupe_csv, allowed_file

import os
import logging

from flask import Flask, render_template, request, send_file
from gunicorn.app.base import BaseApplication

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

app = Flask(__name__)


@app.route("/", methods=["GET"])
def home():
    return render_template("home.html")


@app.route("/upload", methods=["POST"])
def upload_file():
    from werkzeug.utils import secure_filename

About this template

A webpage that dedupes a CSV based on the values in the first column and allows for downloading.

Introduction to the CSV Deduper Template

Welcome to the CSV Deduper template guide. This template is designed to help you build a web application that can deduplicate a CSV file based on the values in a selected column. The application allows users to upload a CSV file, preview the data, select a column for deduplication, and download the deduplicated file. This step-by-step guide will walk you through using the template on the Lazy platform.

Getting Started with the Template

To begin using the CSV Deduper template, simply click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.

Test: Deploying the App

Once you have the template loaded, press the "Test" button to start the deployment of your app. The Lazy platform handles all the deployment details, so you don't need to worry about installing libraries or setting up your environment.

Entering Input

If the template requires user input, the Lazy App's CLI interface will prompt you to provide the necessary information after you press the "Test" button. Follow the prompts to enter any required input.

Using the App

After deployment, the app will provide a user interface where you can upload your CSV file. Here's how to use it:

  • Go to the provided server link to access the web application.
  • Use the upload form to select and submit your CSV file.
  • Preview the first row of your CSV and choose the column you want to deduplicate by.
  • Submit the form to deduplicate the file.
  • Download the deduplicated CSV file from the success page.

Integrating the App

If you need to integrate this app into another service or frontend, you can use the server link provided by Lazy to make API calls or embed the deduplication functionality into your existing tools. Ensure you follow any specific integration steps required by the external tool, such as adding API endpoints or configuring web components.

If the template includes links to documentation or sample code that is helpful for integration, be sure to refer to those resources for additional guidance.

By following these steps, you should be able to successfully deploy and use the CSV Deduper template on the Lazy platform. Enjoy building your deduplication tool with ease!

Category
Technology
Last published
May 18, 2024

More templates like this

To-Do App

A great starting point for a feature-rich To-do List app. This skeleton supports adding, editing, deleting, and prioritizing tasks with due dates and reminders. It's built with Flask and SQLAlchemy, ensuring easy database management. The responsive UI is powered by Tailwind CSS, making it user-friendly and visually appealing. Perfect for creating a robust task management system with potential for further enhancements like project management and collaboration tools.

Flask

FALLBACK | Flask, HTML, JS and Tailwind Based Website

This is a good starting point for styled website. It has a header, footer. Has Tailwind and Flowbite loaded so you can build nice looking pages from here.

Flask
HTML

Versatile Input Form

Develop a versatile input form for users.

Streamlit
Python
Home
/
CSV Deduper