diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-09-25 11:58:55 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-09-25 11:58:55 -0400 |
commit | d1892ef5c9a08049a3be73e0e9903c605bfedcd9 (patch) | |
tree | acc900a70f455b058feb4782832471d9e202ee92 /toBlackboardCSV.py | |
parent | 1c598144f1cc5b493c858f7ac68728547d9e99db (diff) | |
download | GradeBook-d1892ef5c9a08049a3be73e0e9903c605bfedcd9.tar.gz GradeBook-d1892ef5c9a08049a3be73e0e9903c605bfedcd9.zip |
python reformated
Diffstat (limited to 'toBlackboardCSV.py')
-rwxr-xr-x | toBlackboardCSV.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/toBlackboardCSV.py b/toBlackboardCSV.py index 7837ea7..019158c 100755 --- a/toBlackboardCSV.py +++ b/toBlackboardCSV.py @@ -10,24 +10,32 @@ import sqlite3 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) +# 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) +dOut["UserName"] = dOut["UserName"].str.replace("@.*$", "", regex=True) +dOut.rename(columns={"UserName": "Username"}, inplace=True) # exclude inforows -dOut = dOut.loc[ dOut['GroupName'].isin(['student']) ] +dOut = dOut.loc[dOut["GroupName"].isin(["student"])] # remove unneeded info cols -infoCol=['FirstName', 'LastName', 'GroupName', 'UserHiddenColums', 'UserHiddenGroups', 'UserHiddenGradeCategories', 'SectionNum', 'IdNum'] +infoCol = [ + "FirstName", + "LastName", + "GroupName", + "UserHiddenColums", + "UserHiddenGroups", + "UserHiddenGradeCategories", + "SectionNum", + "IdNum", +] dOut = dOut.drop(infoCol, axis=1) -fout = 'BlackBoard.csv' -dOut.to_csv('BlackBoard.csv', index=False) -print(f'Data was exported to {fout}') - +fout = "BlackBoard.csv" +dOut.to_csv("BlackBoard.csv", index=False) +print(f"Data was exported to {fout}") |