Skip to content

Commit 2a450ed

Browse files
committed
notes to text 98% done
1 parent 0f34ce6 commit 2a450ed

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Backend/NotesToText.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ def pdf_to_images_from_bytes(pdf_content, output_folder, file_name):
4949
noImg = i+1
5050
return image_paths, noImg
5151

52-
@router.get("/notestotext")
53-
def NotesToText_handler():
52+
53+
def convert(s):
5454
substring_to_remove = "Scanned by CamScanner"
5555
s3_bucket_name = 'learnmateai'
5656

5757

58-
prefix = 'notes_pdf/'
58+
prefix = s
5959

6060
# List files in the S3 bucket with the specified prefix
6161
response = s3.list_objects_v2(Bucket=s3_bucket_name, Prefix=prefix)
@@ -116,6 +116,15 @@ def NotesToText_handler():
116116
response.error.message))
117117

118118

119+
@router.get("/notestotext")
120+
def NotesToText_handler():
121+
122+
prefix = 'notes_pdf/'
123+
prefix2 = 'pyqs_pdf/'
124+
convert(prefix)
125+
convert(prefix2)
126+
127+
119128

120129
@router.post("/notestotext_modwise")
121130
async def upload_files1(files: List[UploadFile] = File(...)):

__pycache__/app.cpython-310.pyc

-53 Bytes
Binary file not shown.

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#from Backend.Notes_Analyser import router as api4_router
99
#from Backend.Narrator import router as api5_router
10-
from Backend.pyqsorter import router as sorter
10+
#from Backend.pyqsorter import router as sorter
1111
from Backend.NotesToText import router as notestotxt
1212

1313
# import other API routers as needed
@@ -30,7 +30,7 @@
3030
# Mount the API routerss
3131
#app.include_router(api1_router)
3232

33-
app.include_router(sorter)
33+
#app.include_router(sorter)
3434
#app.include_router(api4_router)
3535
#app.include_router(api6_router)
3636
app.include_router(notestotxt)

0 commit comments

Comments
 (0)