[email protected]
commited on
Commit
Β·
30fbdf8
1
Parent(s):
8d79d7e
edit codes
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
import csv
|
2 |
-
import json
|
3 |
import streamlit as st
|
4 |
from dotenv import load_dotenv
|
5 |
from PyPDF2 import PdfReader
|
@@ -30,29 +28,17 @@ def get_pdf_text(pdf_docs):
|
|
30 |
# κ³Όμ
|
31 |
# μλ ν
μ€νΈ μΆμΆ ν¨μλ₯Ό μμ±
|
32 |
|
33 |
-
# Text file extraction
|
34 |
def get_text_file(docs):
|
35 |
-
|
|
|
|
|
|
|
36 |
|
37 |
-
|
38 |
-
# CSV file extraction
|
39 |
def get_csv_file(docs):
|
40 |
-
|
41 |
-
temp_filepath = os.path.join(temp_dir.name, "temp.csv")
|
42 |
-
with open(temp_filepath, "wb") as f:
|
43 |
-
f.write(docs.getvalue())
|
44 |
-
|
45 |
-
with open(temp_filepath, "r") as csv_file:
|
46 |
-
csv_reader = csv.reader(csv_file)
|
47 |
-
csv_data = [row for row in csv_reader]
|
48 |
-
|
49 |
-
return csv_data
|
50 |
-
|
51 |
|
52 |
-
# JSON file extraction
|
53 |
def get_json_file(docs):
|
54 |
-
|
55 |
-
return json_data
|
56 |
|
57 |
|
58 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from dotenv import load_dotenv
|
3 |
from PyPDF2 import PdfReader
|
|
|
28 |
# κ³Όμ
|
29 |
# μλ ν
μ€νΈ μΆμΆ ν¨μλ₯Ό μμ±
|
30 |
|
|
|
31 |
def get_text_file(docs):
|
32 |
+
file_path = 'study_plan.txt' # Replace with your file path
|
33 |
+
with open(file_path, 'r') as text_file:
|
34 |
+
result = get_text_file(text_file)
|
35 |
+
print(result)
|
36 |
|
|
|
|
|
37 |
def get_csv_file(docs):
|
38 |
+
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
|
|
40 |
def get_json_file(docs):
|
41 |
+
pass
|
|
|
42 |
|
43 |
|
44 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|