aboutsummaryrefslogtreecommitdiff
path: root/toBlackboardCSV.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2023-10-25 14:58:11 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2023-10-25 14:58:11 -0400
commit957b8f458d46ec331ac56f7f4a26c4ba8f76b97d (patch)
tree059c2f387efa22a7a9d2261983adcf0e9ad32552 /toBlackboardCSV.py
parent33fa2ddb517fd5b97327ad4c8075cb71b86d7765 (diff)
downloadGradeBook-957b8f458d46ec331ac56f7f4a26c4ba8f76b97d.tar.gz
GradeBook-957b8f458d46ec331ac56f7f4a26c4ba8f76b97d.zip
draft of the gradebook converter to BlackBoard roster
Diffstat (limited to 'toBlackboardCSV.py')
-rw-r--r--toBlackboardCSV.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/toBlackboardCSV.py b/toBlackboardCSV.py
new file mode 100644
index 0000000..e248978
--- /dev/null
+++ b/toBlackboardCSV.py
@@ -0,0 +1,28 @@
+import sys
+import pandas as pd
+import numpy as np
+import os
+import sqlite3
+
+# infile = 'gb.db'
+infile = sys.argv[1]
+con = sqlite3.connect(infile)
+
+#dIn=pd.read_sql("Select * from 'GradesTable' where GroupName='student'", con)
+dIn=pd.read_sql("Select * from 'GradesTable'", con)
+
+
+dOut = dIn.copy()
+
+# replacing user names in accordance with BlackBoard
+dOut['UserName'] = dOut['UserName'].str.replace('@.*$', '', regex=True)
+dOut.rename(columns={'UserName':'Username'}, inplace=True)
+
+# exclude inforows
+dOut = dOut.loc[ dOut['GroupName'].isin(['student']) ]
+
+# remove unneeded info cols
+infoCol=['FirstName', 'LastName', 'GroupName', 'UserHiddenColums', 'UserHiddenGroups', 'UserHiddenGradeCategories', 'SectionNum', 'IdNum']
+dOut = dOut.drop(infoCol, axis=1)
+
+dOut.to_csv('BlackBoard.csv', index=False)