Skip to content

hamsukydev/Python-Flask-CRUD-CSV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Flask Application with CRUD, import and export CSV file

Feature

  • Add / Create new transit information.
  • Update / Edit transit information.
  • Delete transit information.
  • Upload / import csv file data to database.
  • Dowmload / export csv file.

Setup Database

  1. Start wampserver/xampp
  2. Create a database name ' flask_project ' on phpmyadmin
  3. Open command prompt type ' python '
  4. Type ' from app import db'
  5. Type ' db.create_all() '

Rest Api
GET http://localhost/
GET http://localhost/int:id
POST http://localhost/create/int:id
POST http://localhost/update/int:id
POST http://localhost/delete/int:id
POST http://localhost/upload/
GET http://localhost/csv_report/

Precautions For Using This Application

  • Don't send NaN values to the database.

  • Follow the CSV structure when manually creating or entering data into a .csv file.


    Example:


  • CSV file you are going to upload no need inculde table field name.

  • Upload feature for this application only accept .CSV files.

  • Upload feature not support multiple files upload.

  • Upload new csv file will update all existing data in the database.

Violation any of the above will cause errors.


How to run this application?

  1. Open command prompt.
  2. Type 'pip install flask'.
  3. Type 'pip install flask-sqlalchemy'.
  4. Type 'flask run' (Running on http://127.0.0.1:5000/).

Reference

  1. Flask CRUD Application with SQLAlchemy

  2. Flask Tutorial: Upload CSV file and Insert rows into MySQL Database

  3. Generate CSV Report from MySQL Database using Python Flask

About

Python Flask Application with CRUD, import and export CSV file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published