0% found this document useful (0 votes)
70 views32 pages

Absentee Generator Project Report

This document provides a report on an absentee generator project created to help find absentees during online classes through Microsoft Teams. It includes an index, sections on the about, introduction, theory, project flowcharts, algorithms, source code, outputs, journey of the project, precautions, and requirements. The project consists of two apps - a detailed absentee generator that processes multiple files to generate absentee reports in Excel, and a quick absentee generator that compares one file and provides absentees on the app. It uses Python, Tkinter for the GUI, Pandas to manipulate data, and XLWT to generate Excel files. The algorithms describe how the apps open and process attendance files from Teams to identify absentees based on attendance times and

Uploaded by

AIO All in one
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views32 pages

Absentee Generator Project Report

This document provides a report on an absentee generator project created to help find absentees during online classes through Microsoft Teams. It includes an index, sections on the about, introduction, theory, project flowcharts, algorithms, source code, outputs, journey of the project, precautions, and requirements. The project consists of two apps - a detailed absentee generator that processes multiple files to generate absentee reports in Excel, and a quick absentee generator that compares one file and provides absentees on the app. It uses Python, Tkinter for the GUI, Pandas to manipulate data, and XLWT to generate Excel files. The algorithms describe how the apps open and process attendance files from Teams to identify absentees based on attendance times and

Uploaded by

AIO All in one
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

ABSENTEE

GENERATOR
PROJECT REPORT SUBMITTED BY:
Aditya Amit Kinjawadekar
Akash Amit Kinjawadekar
ACKNOWLEDGEMENT

I would like to express my sincere thanks to the Almighty God for


being able to complete this project.
I would like to thank my brother Master Akash Kinjawadekar who
provided crucial support for the completion of the project
I would also like to thank my parents, teachers and friends who
helped me in finalizing this project within the limited time frame.

Page | 2
INDEX

SL. No Contents Page No

1 About 4
2 Introduction 5
3 Theory 6
4 Project Flowchart 8
5 Project Algorithm 10
6 Source Code 15
7 Output 22
8 Journey of the Project 28
9 Precautions 31
10 Requirements 31
11 Bibliography 32

Page | 3
ABOUT

This Project is created to help find the Absentees during online


classes through Microsoft Teams. This project consists of two apps:
 Detailed Absentee Generator: This App helps to process
multiple files (up to 10) at a time and compare it with a user
given main file to give the absentees. The report is exported
as an excel file where the absentees are sorted date wise.
 Quick Absentee Generator: This app helps to compare one
file with the user given main file to give the absentees quickly
on the same app instead of exporting it to Excel.

Page | 4
INTORDUCTION

Due to the COVID-19 pandemic, many schools were forced


to shift to online mode of education. This shift from onsite to
online was not easy, it required apps that would help
connect students and teachers virtually. Microsoft Teams
was one such application that gained popularity during the
pandemic and was used by many schools for online
education worldwide. Microsoft Teams has a feature of
exporting the attendance after every class as a CSV file.
This App focuses specifically on the generation of
attendance records through the MS Teams attendance file.
The feature of generating absentee record is not available
in MS Teams as on today. This free project utilizes the data
from MS Teams to find the absentee records which are an
essential and integral part of academics at any level.

Page | 5
THEORY

PYTHON:-Python is an interpreted, high-level, general-


purpose programming language, Created by Guido van
Rossum and first released in 1991.
It is used for:
 web development (server-side),
 software development,
 mathematics,
 System scripting.

What can Python do?


 Python can be used on a server to create web applications.
 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and
modify files.
 Python can be used to handle big data and perform complex
mathematics.
 Python can be used for rapid prototyping, or for production-
ready software development.

Page | 6
We are using the same programming language because
Python’s design philosophy emphasizes code readability
with its notable use of significant whitespace. Its language
constructs and object-oriented approach aim to help
programmers write clear, logical code for small and large-
scale projects
THE MODULES USED

 Tkinter: Python offers multiple options for developing GUI


(Graphical User Interface). Out of all the GUI methods,
tkinter is the most commonly used method.
 Pandas: In computer programming, pandas is a software
library written for the Python programming language for
data manipulation and analysis. In particular, it offers
data structures and operations for manipulating
numerical tables and time series. It is free software
released under the three-clause BSD license.
 XLWT: This is a library for developers to use to generate
spreadsheet files compatible with Microsoft Excel
versions 95 to 2003.
The package itself is pure Python with no dependencies
on modules or packages outside the standard Python
distribution.

Page | 7
PROJECT FLOWCHART
DETAILED ABSENTEE GENERATOR

Page | 8
QUICK ABSENTEE GENERATOR

Page | 9
PROJECT ALGORITHM
DETAILED ABSENTEE GENERATOR
I. Create a folder called Detailed Absentee Generator and create a file
called main.py
II. Inside the main.py import the modules tkinter, pandas, subprocess, os,
datetime, xlwt and filedialog from tkinter
III. Using os get the current working directory and store in a variable folder
IV. Create an empty list called mainlist and two dictionaries called
absentee_check_dictionary and absentee_dictionary
V. Get todays date using datetime and store in today
VI. Store time_of_class as 60
VII. Create a function called time_calculate that converts a time_string to
seconds and returns the value
VIII. Create a function called print_to_excel that takes in the data as
dictionary and creates an Excel file with today as its name
IX. Create a function called open_file that uses subprocess to open the file
with the file_path given as the parameter

X. Create a function called entry that takes the absentee_check_dictionary


and checks for the student in absentee_check_list which are not in the
main_list and adds it to a list called absentee. It also checks if the
attendance time of students is less than half of time_of_class. This is
done by converting the time_strings in the joined_list and left_list to
seconds by the time_calculate function and subtracting the left_time
by the joined time and checking it with half the time_of_class in
seconds. These students are considered as absent and appends it to
the same list. After the checking is completed it takes the

Page | 10
absentee_dictionary and adds the list absentee as the value with the
date of class as the key in the following format:
{date: absentees}
The the print to excel is called in which the absentee_dictionary is
passed as the parameter

XI. Create a function called file_open that uses filedialog to get the file
path and check the type of file. If the file is mainlist then it use pandas
to read the csv file and extract the data under the column ‘Names’ and
append the list to mainlist. If the file is absentee file then create three
lists called joined_list , left_list, absentee_check_list. Use pandas to read
cav of the file and extract data under the column ‘Name’ and append
it to absentee_check_list. Extract the data under the column ‘User
Action’ and get the joined list by checking if the action is joined or left
list if the user action is left. It also checks if two consecutive actions are
joined for different students then it appends the left time as
‘100:100:100’ which means the student left the class after the
attendance was taken. After this it takes date of class from the first
index of the Timestamp column and stores it as date. Finally this data
is exported to absentee_check_dictionary in the following format:-
{date:
{
"date": date,
"absentee_check_list":absentee_check_list,
"joined_list": joined_list,
"left_list": left_list
}
}

XII. Now use Python classes to create a body class that has a method called
create button that creates a tkinter button at given position and with
the given function

Page | 11
XIII. Start a tkinter window as root
XIV. Create a button with a text called “Choose Main File”. When pressed
the button the file_open function is called and mainfile parameter is
given
XV. Now create a Label and an Option menu with values from 1 to 10
asking the user for number of absentee files. Create an enter button
which when pressed stores the user input as an integer and starts the
function given below
XVI. Use an for loop to iterate the number of times given by the user and
creating as many buttons using the create button method of the Body
class and giving the function of file_open with the parameter of
absentee file. Display the file name on respective buttons using tkinter
grid and Labels
XVII. Create another Enter button which when clicked starts the entry
function.
XVIII. End the program using root.mainloop() which helps it run till close
button is clicked
XIX. If the program is successful then create a button that allows user to
open the file directly by calling the open_file function

Page | 12
QUICK ABSENTEE GENERATOR
Step 1. Create a folder called Quick Absentee Generator and create a file called
main.py
Step 2. Inside the main.py import the modules tkinter, pandas, and filedialog
from tkinter
Step 3. Create two empty lists called mainlist and absentee_list and a
dictionary called absentee_check_dictionary
Step 4. Store time_of_class as 60
Step 5. Create a function called time_calculate that converts a time_string to
seconds and returns the value
Step 6. Create a function called print_to_window that takes in the data as list
and displays it as tkinter Labels on the output screen
Step 7. Create a function called entry that takes the absentee_check_dictionary
and checks for the student in absentee_check_list which are not in the
main_list and adds it to a list called absentee. It also checks if the
attendance time of students is less than half of time_of_class. This is
done by converting the time_strings in the joined_list and left_list to
seconds by the time_calculate function and subtracting the left_time
by the joined time and checking it with half the time_of_class in
seconds. These students are considered as absent and appends it to
the same list. After the checking is completed the print_to_window is
called in which the absentee_list is passed as the parameter
Step 8. Create a function called file_open that uses filedialog to get the file
path and check the type of file. If the file is mainlist then it use pandas
to read the csv file and extract the data under the column ‘Names’ and
append the list to mainlist. If the file is absentee file then create three
lists called joined_list , left_list, absentee_check_list. Use pandas to read
cav of the file and extract data under the column ‘Name’ and append

Page | 13
it to absentee_check_list. Extract the data under the column ‘User
Action’ and get the joined list by checking if the action is joined or left
list if the user action is left. It also checks if two consecutive actions are
joined for different students then it appends the left time as
‘100:100:100’ which means the student left the class after the
attendance was taken. After this it takes date of class from the first
index of the Timestamp column and stores it as date. Finally this data
is exported to absentee_check_dictionary in the following format:-
{date:
{
"date": date,
"absentee_check_list":absentee_check_list,
"joined_list": joined_list,
"left_list": left_list
}
}

Step 9. Now use Python classes to create a body class that has a method called
create button that creates a tkinter button at given position and with
the given function
Step 10. Start a tkinter window as root
Step 11. Create a button with a text called “Choose Main File”. When pressed
the button the file_open function is called and mainfile parameter is
given
Step 12. Create a button asking for absentee file using the create button
method of the Body class and giving the function of file_open with the
parameter of absentee file. Display the file name on button using grid
and Label
Step 13. Create an Enter button which when clicked starts the entry function.
Step 14. End the program using root.mainloop() which helps it run till close
button is clicked

Page | 14
SOURCE CODE
DETAILED ABSENTEE GENERATOR
import tkinter as tk

from tkinter import filedialog

import pandas as pd

import xlwt

import datetime

import os

import subprocess

folder = str(os.getcwd())

main_list = []

absent_check_dictionary = {}

absentee_dictionary = {}

time_of_class = 60

font = ("Gadugi", 20)

today = datetime.datetime.now().strftime("%d-%m-%Y")

def time_calculate(time_string):

time_string = time_string[:-2]

time_list = str(time_string).split(":")

time = int(time_list[0]) * 3600 + int(time_list[1]) * 60 + int("00" +


time_list[2])

return time

Page | 15
def print_to_excel(data):

pass

def open_file(file_path):

subprocess.call(f"explorer {file_path}", shell=True)

def entry():

main_dictionary = absent_check_dictionary

for d in main_dictionary:

absentees = []

date = main_dictionary[d]['date']

joined_list = main_dictionary[d]['joined_list']

left_list = main_dictionary[d]['left_list']

absentee_check_list = main_dictionary[d]['absentee_check_list']

for i in range(0, len(joined_list)):

join_time = time_calculate(joined_list[i])

leave_time = time_calculate(left_list[i])

if leave_time - join_time < time_of_class / 2:

absentees.append(absentee_check_list[i])

for student in main_list:

if student not in absentee_check_list:

absentees.append(student)

absentee_dictionary.update({date: absentees})

print_to_excel(absentee_dictionary)

Page | 16
def file_open(query, row, column, column_span=1):

pass

class Body:

def __init__(self):

self.button = None

def button_create(self, text, row, column, column_span=1, enter=False):

if enter:

self.button = tk.Button(text=text, command=lambda: entry(), font=font)

else:

self.button = tk.Button(text=text, font=font, command=lambda:


file_open(text, row, column, column_span))

if self.button['state'] == tk.ACTIVE:

self.button['relief'] = tk.FLAT

self.button.grid(sticky="nsew", row=row, column=column,


columnspan=column_span)

body = Body()

root = tk.Tk()

root.title("Detailed Absentee Generator")

def number_of_files_entry():

row = 2

enter_number_of_files.destroy()

Page | 17
for file in range(int(number_of_files.get())):

body.button_create(f"Choose File {file + 1}", row, 0, 3)

row += 1

body.button_create("Enter", row + 1, 0, 3, True)

body.button_create("Choose Main File", 0, 0, 3)

label_number_of_files = tk.Label(text="Choose The Number Of Files:- ", font=font)

number_of_files = tk.StringVar()

number_of_files.set(1)

number_of_files_option_menu = tk.OptionMenu(root, number_of_files, *range(1, 11))

number_of_files_option_menu.config(font=font)

label_number_of_files.grid(sticky="nsew", row=1, column=0)

number_of_files_option_menu.grid(sticky="nsew", row=1, column=1)

enter_number_of_files = tk.Button(text="Enter", command=number_of_files_entry,


font=font)

enter_number_of_files.grid(sticky="nsew", row=1, column=2)

label_success = tk.Label(text="Absentee File Generated Successfully", font=font)

files = folder + f"\\{today}_absentees.xls"

file_output = tk.Button(text="Open The Absentee File", command=lambda:


open_file(files), font=font)

root.mainloop()

Page | 18
QUICK ABSENTEE GENERATOR
import tkinter as tk

from tkinter import filedialog

import pandas as pd

main_list = []

absent_check_dictionary = {}

absentee_list = []

time_of_class = 60

font = ("Gadugi", 20)

output_font = ("Gadugi", 14)

def time_calculate(time_string):

time_string = time_string[:-2]

time_list = str(time_string).split(":")

time = int(time_list[0]) * 3600 + int(time_list[1]) * 60 + int("00" +


time_list[2])

return time

def print_to_window(data):

pass

def entry():

main_dictionary = absent_check_dictionary

absentees = []

Page | 19
for d in main_dictionary:

joined_list = main_dictionary[d]['joined_list']

left_list = main_dictionary[d]['left_list']

absentee_check_list = main_dictionary[d]['absentee_check_list']

for i in range(0, len(joined_list)):

join_time = time_calculate(joined_list[i])

leave_time = time_calculate(left_list[i])

if leave_time - join_time < time_of_class / 2:

absentees.append(absentee_check_list[i])

for student in main_list:

if student not in absentee_check_list:

absentees.append(student)

print_to_window(absentees)

def file_open(query, row, column, column_span=1):

pass

class Body:

def __init__(self):

self.button = None

def button_create(self, text, row, column, column_span=1, enter=False):

if enter:

self.button = tk.Button(text=text, command=lambda: entry(), font=font)

else:

Page | 20
self.button = tk.Button(text=text, font=font, command=lambda:
file_open(text, row, column, column_span))

if self.button['state'] == tk.ACTIVE:

self.button['relief'] = tk.FLAT

self.button.grid(sticky="nsew", row=row, column=column,


columnspan=column_span)

def button_destroy(self):

self.button.destroy()

if __name__ == '__main__':

body = Body()

root = tk.Tk()

root.title("Quick Absentee Generator")

def number_of_files_entry():

body.button_create(f"Choose The Absentee File", 1, 0, 3)

body.button_create("Enter", 2 + 1, 0, 3, True)

body.button_create("Choose Main File", 0, 0, 3)

number_of_files_entry()

root.mainloop()

The exe files for both apps are available at


https://drive.google.com/drive/folders/1WBdxS_fwvdhtMFMzD0PSXSLmdH5SEhtx?usp=sharing

Page | 21
OUTPUT
DETAILED ABSENTEE GENERATOR

The default Screen after Running the App which asks for
main file and number of Absentee Files.

The screen after main.csv is selected as the main file.

Page | 22
Three Files are chosen

Three buttons are created asking to choose the absentees


files

Page | 23
Screen after 1.csv, 2.csv and 3.csv are chosen

After the Enter button is clicked a success label is shown if not


shown there is some error which is discussed later. There is an
option for opening the file directly by clicking the Open the
Absentee File

Page | 24
The excel file with the column names as the date of class

The file is stored in the same folder where your application


is and it has a name of today’s date plus absentees.xls

Page | 25
QUICK ABSENTEE GENERATOR

The default Screen after Running the App which asks for
main file and absente File.

The screen after main.csv is selected as the main file.

Page | 26
Screen after 1.csv is chosen

After the Enter button is clicked the absentees are displayed and
the total number of absentees are also shown.

Page | 27
JOURNEY OF THE PROJECT

The Project Started when I saw my parents filtering the


Teams data for entering the Absentees manually. That time
I got the idea of using the pandas module to create a
backend software that would take a file path and then give
the absentees based on manual criteria. The output would
be plain text.
Later on after my parents advice I built a GUI front end that
would work independently on any Windows PC. Then I
showed the app to my computer teacher Mrs.Shilpa AG who
helped me to present it in front of our principal Mrs.Jessy
Andrews who encouraged for further developments
regarding the excel output and ability to process multiple
files. After the project was completed it was shared to:-
i. My school, Madhava English Nursery and Higher
Primary School, Manipal
ii. Manipal School Of Architecture and Planning , Manipal
iii. Manipal Institute of Technology, Manipal

Page | 28
The app received many positive responses

Page | 29
The app has undergone three updates since its launching.
The first update helped it solve the encoding error which
occurred due to different encoding of Teams file. The
second update helped find the students who were present
for less than half the time of a class and considered them
as absent. The third update helped to make the app more
efficient by enhancing the visual appearance and
refactoring the code. Tr.Saatyavati encouraged me to
send this project to ATL Marathon 2020

Page | 30
PRECAUTIONS

 The Project is designed for files generated by MS


Teams and hence might not work for other files
 It is better to use the attendance file downloaded
directly from MS Teams instead of opening it and
editing it
 The main file should be in the same format like the
attendance file from teams

REQUIREMENTS

 Windows PC / Laptop
 Python 3 with pip installed

Page | 31
BIBLIOGRAPHY

 https://www.udemy.com/course/100-days-of-
code/
The course taken by me to learn the basics of python.
 https://www.youtube.com/watch?v=vmEHCJofslg
More about pandas python package
 https://www.youtube.com/watch?v=FbWnuO7GG
BQ
About xlwt module of python
 https://www.youtube.com/watch?v=YXPyB4XeYLA
Information about python tkinter

Page | 32

You might also like