Code Monkey home page Code Monkey logo

pmutua / drf_csv_xlsx_file_upload Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 3.0 1.37 MB

API uploads .csv/.xlsx for bulk data, queries via text for accurate results. Integrated with OpenAI using Langchain library. Watch full implementation via this video below.

Home Page: https://www.youtube.com/watch?v=gXYvhHocz84&t=4333s

Python 6.31% CSS 44.68% JavaScript 49.01%
csv-files xlsx-files django-rest-framework uploading-files bulk-inserts django python python3 api-rest csv

drf_csv_xlsx_file_upload's Introduction

Drf File Upload

API allows a user to upload .csv & xlsx files containing patient names and emails then load the data into the database. Query Database and csv data with langchain.

Requirements:

Python >=3.0
Django==3.0
djangorestframework==3.14.0
pandas==2.0.3
langchain==0.0.229
openai
tabulate

Features

  • Uploading a file.

  • Import works only for *.csv or *.xlsx files.

  • Show error message if one tries to upload files in other formats.

  • Show response when the import is done

  • Show response if import wasn't done and the reason why.

  • List all patients after the file has been uploaded.

  • Query Database with LLM

  • Query CSV with LLM

Usage

Run:

python manage.py makemigrations

python manage.py migrate

Create User

python manage.py createsuperuser follow prompt

Making a POST request

    alt text

View the new data seeded

    alt text

TODO

  • Show error message if the file is corrupted.

Author

Philip Mutua

drf_csv_xlsx_file_upload's People

Contributors

hariihe avatar pmutua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.