UjjwalVIT commited on
Commit
9ef1ac7
1 Parent(s): 8e7403a
Files changed (1) hide show
  1. Metadata.py +3 -20
Metadata.py CHANGED
@@ -17,7 +17,7 @@ import time
17
  from PyPDF2 import PdfReader
18
  timestr = time.strftime("%Y%m%d-%H%M%S")
19
 
20
- import sqlite3
21
 
22
  details = """
23
  Metadata is defined as the data providing information about one or more aspects of the data; it is used to summarize basic information about data which can make tracking and working with specific data easier
@@ -37,15 +37,9 @@ def file_download(data):
37
  href=f'<a href="data:file/csv;base64,{b64}" download="{new_filename}"> Click Here! </a>'
38
  st.markdown(href, unsafe_allow_html=True)
39
 
40
- conn=sqlite3.connect('data.db')
41
- c=conn.cursor()
42
 
43
- def create_filestable():
44
- c.execute('CREATE TABLE IF NOT EXISTS filestable(filename TEXT,filetype TEXT,filesize TEXT,uploadDate TIMESTAMP)')
45
 
46
- def add_file_details():
47
- c.execute('INSERT INTO filestable(filename, filetype, filesize, uploadDate) VALUES (?, ?, ?, ?)', (filename, filetype, filesize, uploadDate))
48
- conn.commit()
49
 
50
  def view_all_data():
51
  c.execute('SELECT * FROM filestable')
@@ -177,7 +171,6 @@ def metadata():
177
  st.write(lat)
178
  st.write(long)
179
 
180
- add_file_details(img.filename,img.format,img.size,datetime.now())
181
  with st.expander('Download Results'):
182
  final_df=pd.concat([file_details_df,df_img_details,meta_data_df])
183
  st.dataframe(final_df)
@@ -202,7 +195,6 @@ def metadata():
202
  "FileSize": audio_file.size,
203
  "FileType": audio_file.type,
204
  }
205
- add_file_details(audio_file.name,audio_file.type,audio_file.size,datetime.now())
206
 
207
  st.write(file_details)
208
 
@@ -254,7 +246,6 @@ def metadata():
254
  "FileSize": text_file.size,
255
  "FileType": text_file.type,
256
  }
257
- add_file_details(text_file.name,text_file.type,text_file.size,datetime.now())
258
 
259
  st.write(file_details)
260
 
@@ -297,15 +288,7 @@ def metadata():
297
  st.dataframe(pdf_combined_df)
298
  file_download(pdf_combined_df)
299
 
300
- elif choice=='Analytics':
301
- st.subheader('Analytics')
302
- uploaded_files= view_all_data()
303
- df=pd.DataFrame(uploaded_files,columns=['Filename','Filetype','Filesize','UploadDate'])
304
- with st.expander('Monitor'):
305
- st.success('View all uploaded files')
306
- st.dataframe(df)
307
-
308
- #Monitor uploads
309
 
310
 
311
 
 
17
  from PyPDF2 import PdfReader
18
  timestr = time.strftime("%Y%m%d-%H%M%S")
19
 
20
+
21
 
22
  details = """
23
  Metadata is defined as the data providing information about one or more aspects of the data; it is used to summarize basic information about data which can make tracking and working with specific data easier
 
37
  href=f'<a href="data:file/csv;base64,{b64}" download="{new_filename}"> Click Here! </a>'
38
  st.markdown(href, unsafe_allow_html=True)
39
 
40
+ )
 
41
 
 
 
42
 
 
 
 
43
 
44
  def view_all_data():
45
  c.execute('SELECT * FROM filestable')
 
171
  st.write(lat)
172
  st.write(long)
173
 
 
174
  with st.expander('Download Results'):
175
  final_df=pd.concat([file_details_df,df_img_details,meta_data_df])
176
  st.dataframe(final_df)
 
195
  "FileSize": audio_file.size,
196
  "FileType": audio_file.type,
197
  }
 
198
 
199
  st.write(file_details)
200
 
 
246
  "FileSize": text_file.size,
247
  "FileType": text_file.type,
248
  }
 
249
 
250
  st.write(file_details)
251
 
 
288
  st.dataframe(pdf_combined_df)
289
  file_download(pdf_combined_df)
290
 
291
+
 
 
 
 
 
 
 
 
292
 
293
 
294