-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocess.py
More file actions
34 lines (26 loc) · 807 Bytes
/
preprocess.py
File metadata and controls
34 lines (26 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
from src.DocManager import DocManager
import os
username = "root"
password = "admin"
dbName = "papers"
bibfile = "mybib.bib"
connfile = "connection.json"
topicfile = "topic.json"
docManager = DocManager()
docManager.initConn(username, password, dbName)
docManager.deleteTbls() # drop tables. DEBUG only
docManager.createTbls()
"""insert document test"""
docManager.insertDocFromBibFile(bibfile, deleteAfterInsert=False)
print("="*20)
docManager.insertTopicFromFile(topicfile, deleteAfterInsert=False)
"""conenct document test"""
print("="*20)
docManager.addConnectionFromFile(connfile, deleteAfterInsert=False)
print(docManager.getAllDocs())
# docManager.exportDocs()
# docManager.exportTopics()
# docManager.exportConnections()
docManager.closeConn()