-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMS Attendance.py
43 lines (31 loc) · 1.34 KB
/
MS Attendance.py
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
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
"""Teams Attendance Marker.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1WFpYKKYqiEhhZu1ra0xozQXdcr1o2Gzw
"""
import pandas as pd
from keyboard import press
print("Welcome to Microsoft Teams Attendance Marker v0.1\n Please make sure you have dropped your Attendance Sheet from the meeting inside the Teams Attendance folder before proceeding..")
#Enter source File name
src=input("Enter your Attendance file name:")
location=(src+".csv")
##Enter destination File Name
dest=input("Please Enter the name you would like to give to the final attendance:")
destname=(dest+".csv")
#this is for reading columns and dataframing
data = pd.read_csv(location,encoding='utf-16', delimiter='\t', usecols=[0])
df = pd.DataFrame(data)
#drop teacher name
#remove duplicate names
df.drop_duplicates(subset ="Full Name",keep = False, inplace = True)
#sort names ascending order
sorted=df.sort_values(by='Full Name')
sorted.to_string(index=False, header=False)
#convert to destination csv file
sorted.to_csv(destname, header=False, index=False)
print(sorted)
print("Number of Students present:",sorted.shape[0]-1) # number of present students excluding teacher
print("Attendance File "+destname+" is ready!")
print("Press enter to close the program ....\n")
press('enter')