https://github.com/pmutua/drf_csv_xlsx_file_upload
Demo Django (Django Rest Framework) 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.
https://github.com/pmutua/drf_csv_xlsx_file_upload
api-rest bulk-inserts csv csv-files csv-reading django django-framework django-rest-framework djangorestframework langchain langchain-python openai-api pandas pandas-projects python python-project python3 uploading-files xlsx-files
Last synced: about 1 month ago
JSON representation
Demo Django (Django Rest Framework) 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.
- Host: GitHub
- URL: https://github.com/pmutua/drf_csv_xlsx_file_upload
- Owner: pmutua
- Created: 2019-05-20T07:33:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-11T05:11:09.000Z (over 1 year ago)
- Last Synced: 2025-03-23T23:26:48.840Z (about 2 months ago)
- Topics: api-rest, bulk-inserts, csv, csv-files, csv-reading, django, django-framework, django-rest-framework, djangorestframework, langchain, langchain-python, openai-api, pandas, pandas-projects, python, python-project, python3, uploading-files, xlsx-files
- Language: JavaScript
- Homepage: https://www.youtube.com/watch?v=gXYvhHocz84&t=4333s
- Size: 1.34 MB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
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
#### View the new data seeded
#### TODO
- Show error message if the file is corrupted.
#### Author
Philip Mutua