0% found this document useful (0 votes)
8 views

Python Mini Project Report (2)

The Attendance Tracker is a Python-based GUI application designed for efficient attendance management, allowing users to mark attendance and store records in a CSV file. Developed using Tkinter, it features functionalities such as student registration, attendance marking, and record viewing, making it suitable for educational institutions and small businesses. The project emphasizes the importance of automation in administrative tasks and showcases practical applications of Python programming.

Uploaded by

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

Python Mini Project Report (2)

The Attendance Tracker is a Python-based GUI application designed for efficient attendance management, allowing users to mark attendance and store records in a CSV file. Developed using Tkinter, it features functionalities such as student registration, attendance marking, and record viewing, making it suitable for educational institutions and small businesses. The project emphasizes the importance of automation in administrative tasks and showcases practical applications of Python programming.

Uploaded by

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

Attendance Tracker

Submitted in partial fulfillment of the requirements of


the degree of

Bachelor of Engineering
By
SHAIKH TASNEEM AZHARUL 231P043 41
SHARMA LUCKY LT KUNJ BIHARI 231P061 42
SAROJ SHRUTI SANTOSH 231P090 30

Guide:
PROF. MOHD ASHFAQUE SHAIKH

Department of Computer Engineering


Rizvi College of Engineering

University of Mumbai
2024-2025

1
CERTIFICATE
This is to certify that the project entitled Attendance Tracker is a bonafide work of Shaikh
Tasneem Azharul (231P043), Lucky Lt Kunj Bihari Sharma (231P060), Saroj Shruti Santosh
(231P090), submitted to the University of Mumbai in partial fulfillment of the requirement for the
award of the degree of “Bachelor of Engineering” in “Computer Engineering”.

Prof. Mohd Ashfaque Shaikh External (Name & Sign)


Guide

Prof. Shiburaj Pappu Dr. Anupam Choudhary


Dean (Academics) Head of Department

Dr. Varsha Shah


Principal

2
Project Report Approval for S.E.

This Project report entitled Attendance Tracker by Shaikh Tasneem Azharul, Lucky Lt Kunj
Bihari, Saroj Shruti Santosh, is approved for the degree of Bachelor of Computer Engineering.

Examiners

1.

2.

Guide
Prof. Mohd Ashfaque Shaikh

Date:

Place: Mumbai

3
DECLARATION

We declare that this written submission represents my ideas in my own words and where others'
ideas or words have been included, we have adequately cited and referenced the original sources.
We also declare that we have adhered to all principles of academic honesty and integrity and have
not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. We
understand that any violation of the above will be cause for disciplinary action by the Institute and
can also evoke penal action from the sources which have thus not been properly cited or from
whom proper permission has not been taken when needed.

------------------------------------------------
(Shaikh Tasneem Azharul, 232P043)

------------------------------------------------
(Lucky Lt Kunj Bihari Sharma, 231P060)

--------------------------------------------
(Saroj Shruti Santosh, 231P090)

Date:

4
ABSTRACT

The Attendance Tracker is a Python based GUI application that allows users to mark their attendance
in a simple and efficient way. Built using Tkinter, it provides an intuitive interface where users can enter
their, name and ID, which are then recorded along with the current date and time in a CSV file.

This ensures that attendance records are stored systematically for future reference. The system provides
instant feedback through a confirmation message upon successful submission. Additionally users have
the option to view all recorded attendance within the application.

The project utilizes Python, Tkinter, CSV handling, and the datetime module, making it a lightweight yet
functional solution for basic attendance tracking needs.

This project serves as a practical implementation of Python concepts such as GUI design, handling, and.
It is suitable for both educational and entertainment purposes, offering a fun way to test knowledge in
various domains.

Keywords: -Attendance Tracker, Graphical User Interface (GUI), questions, , First and last name input,
Quiz topics, Event handling, Educational, Entertainment, Knowledge testing

5
CONTENTS
Sr. Title Page No.
No.
1. Introduction 7

2. Survey on Existing Program 8

3. Methodology 9
4. Flowchart 11
5. Algorithm 13
6. Code 15
7. Conclusion 24
8. References 25

Acknowledgement 26

6
Chapter 1
Introduction
In today's fast-paced world, maintaining accurate and efficient attendance
records is essential in educational institutions and organizations alike. Traditional
methods such as paper-based registers or manual entry systems are time-
consuming, error-prone, and lack real-time accessibility. To overcome these
limitations, we have developed an Attendance Tracker Application using Python
and its Tkinter library for the graphical user interface (GUI).
This project aims to create a simple, user-friendly application that allows
users to mark, store, and manage attendance data digitally. Python, being a
versatile and beginner-friendly language, provides robust support for data
processing and logic implementation. Tkinter, the standard GUI toolkit for Python,
enables the development of interactive desktop applications with minimal code
overhead.
The application includes core functionalities such as adding new students,
marking attendance, viewing daily records, and exporting reports. It is designed to
be lightweight, responsive, and suitable for use in schools, colleges, or small
businesses. Additionally, the modular structure and clean interface make it easy
for future enhancements, such as integrating a database or biometric input.
Overall, this project not only showcases the practical implementation of
Python and Tkinter but also highlights the importance of automation in improving
administrative efficiency.

7
Chapter 2

SURVEY ON EXISTING SYSTEM

Attendance management is a crucial component in educational


institutions, workplaces, and training environments. Traditional methods, such as
paper-based registers and manual data entry, have long been used to record
attendance. However, these approaches are often inefficient, time-consuming, and
prone to human error. With the rise of digital solutions, there has been a significant
shift towards automated systems that offer reliability, accuracy, and ease of use.

 This survey indicates that while there are many attendance solutions
available, there remains a niche for user-friendly, desktop-based tools that
are customizable, offline-capable, and suitable for small to medium-scale use
—precisely what this project aims to deliver.

8
Chapter 3
Methodology
Methodology
The development of the Attendance Tracker application followed a structured
methodology to ensure asystematic approach and timely completion. The Waterfall Model
was adopted for this project, consisting of distinct phases: Requirement Analysis, Design,
Implementation, Testing, and Deployment. Below is a detailed explanation of each phase:
1. Requirement Analysis
 Identified the need for a simple, offline, and cost-effective attendance system.

 Collected functional requirements such as student registration, attendance


marking, viewing records, and report generation.
 Defined non-functional requirements like ease of use, responsiveness, and
scalability.
2. System Design
 Designed the application architecture using a modular approach.

 Created wireframes for the GUI using Tkinter components such as buttons,
labels, entry fields, and tables.
 Decided on the storage mechanism (e.g., CSV file or SQLite database) for data
persistence.
 Flowcharts and UML diagrams were prepared to visualize the workflow and
system logic.
3. Implementation
 Developed the application using Python for backend logic and Tkinter for GUI
development.
 Modules were created for:

o User Interface (UI)

o Student registration

9
o Attendance marking
o Record viewing

o Report exporting

 Ensured user input validation and appropriate error handling.


4. Testing
 Performed unit testing on individual modules to check functionality.

 Conducted integration testing to ensure modules work seamlessly together.

 Executed user testing with sample users (e.g., students or staff) to gather feedback
on usability.
 Fixed bugs and optimized performance based on test results.

5. Tools & Technologies Used


 Programming Language: Python

 GUI Library: Tkinter

 Storage: CSV or SQLite (based on project scope)

 IDE: VS Code / PyCharm

10
.

Chapter 4
Flowchart

11
12
13
Chapter 5
Algorithm

Step 1: Start

Step 2: Initialize the Application


 Import necessary modules: tkinter, sqlite3, and messagebox.
 Connect to (or create) a SQLite database attendance.db.
 Create the attendance table if it does not already exist.

Step 3: Create the Admin Login System


 Display a login window.
 On successful login, open the Admin Dashboard.
Step 4: Dashboard Setup
 Display the main dashboard window with the following sections:
o Attendance table (Treeview)
o Input form for: Student ID, Name, Date, and Status
(Present/Absent)
o Buttons: Mark Attendance, Refresh, Search, Edit, Save
Changes, Delete, Export

Step 5: Mark Attendance


 On "Mark Attendance" button click:
o Validate that all fields are filled.
o Insert the data into the attendance table using an INSERT SQL
query.
o Show a success message and clear the form.

Step 6: View Attendance


 Fetch all records (or filtered ones using search).
 Clear the Treeview table and insert fetched records using a SELECT
query.

Step 7: Search Records


 Read input from search field.
 Run SQL SELECT with LIKE clause to filter based on student ID, name,
or date.
 Display matching records in the Treeview.

Step 8: Edit Records


 On selecting a row and clicking "Edit Record":

14
o Autofill the form fields with selected record data.

Step 9: Save Edited Record


 On clicking "Save Changes":
o Update the corresponding record using an UPDATE SQL
query.
o Refresh the table and show a success message.

Step 10: Delete Records


 On selecting one or more records and clicking "Delete":
 Confirm deletion.
 Delete selected rows using DELETE SQL queries.
 Refresh the table.

Step 11: Export Data


 Export all attendance data to a .csv file.
 Save it to the current working directory or allow the user to choose the
location.
 Show success message on export.

Step 12: Exit


 Close the application and database connection when done.

15
Chapter 6
CODE
dashboard.py:
import csv
import tkinter as tk
from tkinter import ttk
import sqlite3
from tkinter import messagebox

def mark_attendance():
student_id = entry_id.get()
student_name = entry_name.get()
date = entry_date.get()
status = status_var.get()

if not (student_id and student_name and date and status):


messagebox.showerror("Error", "Please fill all fields!")
return

conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

cursor.execute("INSERT INTO attendance (student_id,


student_name, date, status) VALUES (?, ?, ?, ?)",
(student_id, student_name, date, status))

conn.commit()

16
conn.close()

messagebox.showinfo("Success", "Attendance marked


successfully!")
entry_id.delete(0, tk.END)
entry_name.delete(0, tk.END)
entry_date.delete(0, tk.END)
view_attendance() # Refresh table

def select_record():
selected_item = attendance_table.selection()
if not selected_item:
messagebox.showerror("Error", "Please select a record to edit!")
return

item_values = attendance_table.item(selected_item, "values")

# Fill entry fields with selected row data


entry_id.delete(0, tk.END)
entry_id.insert(0, item_values[1])

entry_name.delete(0, tk.END)
entry_name.insert(0, item_values[2])

entry_date.delete(0, tk.END)
entry_date.insert(0, item_values[3])

status_var.set(item_values[4]) # Set radio button selection

print(f" ✏️ Editing Record: {item_values}") # Debugging Print

def save_changes():
selected_item = attendance_table.selection()
if not selected_item:
messagebox.showerror("Error", "Please select a record to save
changes!")
return

17
# Get updated values
new_id = entry_id.get()
new_name = entry_name.get()
new_date = entry_date.get()
new_status = status_var.get()

if not (new_id and new_name and new_date and new_status):


messagebox.showerror("Error", "Please fill all fields!")
return

# Get primary key ID


item_values = attendance_table.item(selected_item, "values")
record_id = item_values[0] # ID column (Primary Key)

conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

# Update the attendance record using ID (not student_id)


cursor.execute("""
UPDATE attendance
SET student_id = ?, student_name = ?, date = ?, status = ?
WHERE id = ?
""", (new_id, new_name, new_date, new_status, record_id))

conn.commit()
conn.close()

messagebox.showinfo("Success", "Changes saved successfully!")


view_attendance() # Refresh table

def view_attendance():

🔍
search_query = search_entry.get().strip() # Get search input
print(f" Searching for: {search_query}") # Debugging print

conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

18
# Query with filtering
if search_query:
cursor.execute("SELECT * FROM attendance WHERE student_id
LIKE ? OR student_name LIKE ? OR date LIKE ?",
(f"%{search_query}%", f"%{search_query}%", f"%
{search_query}%"))
else:
cursor.execute("SELECT * FROM attendance")

rows = cursor.fetchall()
conn.close()

# Clear old data


for row in attendance_table.get_children():
attendance_table.delete(row)

# Insert new data


for row in rows:
attendance_table.insert("", "end", values=row)

print(f" ✅ Found {len(rows)} records.") # Debugging print

def delete_all_records():
confirm = messagebox.askyesno("Confirm", "Are you sure you want
to delete all records?")
if not confirm:
return

conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

cursor.execute("DELETE FROM attendance") # Delete all records


conn.commit()
conn.close()

messagebox.showinfo("Success", "All records have been deleted!")

19
view_attendance() # Refresh the table

def export_to_csv():
conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

cursor.execute("SELECT * FROM attendance")


rows = cursor.fetchall()

conn.close()

if not rows:
messagebox.showwarning("Warning", "No records to export!")
return

with open("attendance_records.csv", "w", newline="") as file:


writer = csv.writer(file)
writer.writerow(["ID", "Student ID", "Name", "Date", "Status"]) #
Header
writer.writerows(rows)

messagebox.showinfo("Success", "Attendance records exported to


'attendance_records.csv'!")
def open_dashboard():
global entry_id, entry_name, entry_date, status_var,
attendance_table, search_entry

dashboard = tk.Toplevel()
dashboard.title("Admin Dashboard")
dashboard.geometry("700x550")

# Search Bar
tk.Label(dashboard, text="Search:").pack(pady=5)
search_entry = tk.Entry(dashboard)
search_entry.pack(pady=5)
tk.Button(dashboard, text="Search",
command=view_attendance).pack(pady=5)

20
# Table for Attendance Records
columns = ("ID", "Student ID", "Name", "Date", "Status")
attendance_table = ttk.Treeview(dashboard, columns=columns,
show="headings")

for col in columns:


attendance_table.heading(col, text=col)
attendance_table.column(col, width=120)

attendance_table.pack(pady=10)

# Buttons
tk.Button(dashboard, text="Refresh Records",
command=view_attendance).pack(pady=5)
tk.Button(dashboard, text="Edit Record",
command=select_record).pack(pady=5)
tk.Button(dashboard, text="Save Changes",
command=save_changes).pack(pady=5)

# Mark Attendance Form


tk.Label(dashboard, text="Student ID:").pack(pady=2)
entry_id = tk.Entry(dashboard)
entry_id.pack(pady=2)

tk.Label(dashboard, text="Student Name:").pack(pady=2)


entry_name = tk.Entry(dashboard)
entry_name.pack(pady=2)

tk.Label(dashboard, text="Date (YYYY-MM-DD):").pack(pady=2)


entry_date = tk.Entry(dashboard)
entry_date.pack(pady=2)

tk.Label(dashboard, text="Status:").pack(pady=2)
status_var = tk.StringVar(value="Present")
tk.Radiobutton(dashboard, text="Present", variable=status_var,
value="Present").pack()
tk.Radiobutton(dashboard, text="Absent", variable=status_var,

21
value="Absent").pack()

tk.Button(dashboard, text="Mark Attendance",


command=mark_attendance).pack(pady=10)
tk.Button(dashboard, text="Delete All Records",
command=delete_all_records, fg="white", bg="red").pack(pady=5)
tk.Button(dashboard, text="Export to CSV",
command=export_to_csv, fg="white", bg="green").pack(pady=5)

# Load attendance records automatically


view_attendance()

dashboard.mainloop()
database.py:
import sqlite3
import bcrypt

def create_tables():
conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

# Attendance table to store student attendance records


cursor.execute('''CREATE TABLE IF NOT EXISTS attendance (
id INTEGER PRIMARY KEY AUTOINCREMENT,
student_id TEXT NOT NULL,
student_name TEXT NOT NULL,
date TEXT NOT NULL,
status TEXT NOT NULL)''')

conn.commit()
conn.close()

# Run this function to ensure tables exist


create_tables()
def add_admin(username, password):
hashed_password = bcrypt.hashpw(password.encode(), bcrypt.gensalt()) #
Encrypt password
print(f"Storing admin: {username}, Hashed Password: {hashed_password}") #
Debugging print

conn = sqlite3.connect("attendance.db")

22
cursor = conn.cursor()

# Ensure the admin table exists


cursor.execute("""
CREATE TABLE IF NOT EXISTS admin (
username TEXT PRIMARY KEY,
password TEXT NOT NULL
)
""")

# Check if admin already exists


cursor.execute("SELECT * FROM admin WHERE username=?", (username,))
existing_admin = cursor.fetchone()

if existing_admin:
print("Admin already exists. Updating password...")
cursor.execute("UPDATE admin SET password=? WHERE username=?",
(hashed_password, username))
else:
print("Adding new admin...")
cursor.execute("INSERT INTO admin (username, password) VALUES (?, ?)",
(username, hashed_password))

conn.commit()
conn.close()
print("Admin credentials stored successfully!")

def authenticate(username, password):


conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

cursor.execute("SELECT password FROM admin WHERE username=?",


(username,))
result = cursor.fetchone()

conn.close()

if result:
stored_password = result[0]

# Convert stored password from string to bytes (if needed)


if isinstance(stored_password, str):
stored_password = stored_password.encode()

23
# Debugging prints
print(f"Stored Hash (bytes): {stored_password}")
print(f"Entered Password: {password}")

if bcrypt.checkpw(password.encode(), stored_password): # Ensure encoding


matches

print(" Password Match!")
return True
else:

print(" Password Mismatch!")
else:

print(" Username Not Found!")

return False
login.py:
import tkinter as tk
from tkinter import messagebox
import dashboard
import sqlite3
import bcrypt
# Import the main dashboard after login

def authenticate(username, password):


conn = sqlite3.connect("attendance.db")
cursor = conn.cursor()

cursor.execute("SELECT password FROM admin WHERE username=?",


(username,))
result = cursor.fetchone()

conn.close()

if result and bcrypt.checkpw(password.encode(), result[0]):


return True
return False

def login():
username = username_entry.get()
password = password_entry.get()

if authenticate(username, password):

24
messagebox.showinfo("Login Successful", "Welcome, Admin!")
root.destroy() # Close login window
dashboard.open_dashboard() # Open main dashboard
else:
messagebox.showerror("Login Failed", "Invalid username or password")

# GUI setup
root = tk.Tk()
root.title("Admin Login")
root.geometry("300x200")

tk.Label(root, text="Username:").pack(pady=5)
username_entry = tk.Entry(root)
username_entry.pack(pady=5)

tk.Label(root, text="Password:").pack(pady=5)
password_entry = tk.Entry(root, show="*")
password_entry.pack(pady=5)

tk.Button(root, text="Login", command=login).pack(pady=10)

root.mainloop()

Chapter 7
CONCLUSION

The development of an Attendance Tracker using Python and

25
Tkinter demonstrates the effectiveness of combining GUI-based
applications with backend data handling in creating practical solutions
for real-world problems. Through this project, key programming
concepts such as event-driven programming, file handling, and modular
design were implemented to build a user-friendly interface for tracking
attendance efficiently.

This project also highlights how Python, with its powerful libraries like Tkinter for
GUI and pandas or CSV modules for data storage, can be leveraged to create scalable
and maintainable desktop applications. The integration of additional features such as
facial recognition, Excel reporting, and automated notifications further enhances the
system's capabilities.

Overall, this project not only improves manual attendance tracking systems but
also provides a strong foundation for future enhancements, such as database
integration or cloud-based access, making it highly adaptable for use in educational
institutions or workplaces.

In conclusion, a Python-based Attendance Tracker not only provides practical


functionality but also demonstrates the power of Python in creating dynamic, cross-
platform desktop applications. It offers an engaging way for users to test their
knowledge while providing a flexible platform for developers to build upon.

26
CHAPTER 8
REFERENCES
References
1. TheRealM4rtin. (2021). Attendance Management System using Python and Tkinter.
GitHub Repository. Retrieved from:
https://github.com/TheRealM4rtin/attendancemanagementsystem
2. TechZone. (2021). Attendance Management System using Python, Tkinter and Filing
[Video]. YouTube. Retrieved from:
https://www.youtube.com/watch?v=YpKp5nVIxOs
3. Code Masala Bytes. (2022). Simple Attendance Tracker Using Python: A Step-by-Step
Guide. Retrieved from:
https://codemasalabytes.com/projects/simple-attendance-tracker-using-python-a-
step-by-step-guide/
4. Code With Faraz. (2023). GUI Face Recognition Attendance System Using Python and
Tkinter. Retrieved from:
https://www.codewithfaraz.com/python/46/gui-face-recognition-attendance-system-
using-python-and-tkinter
5. Soumya18. (2021). Attendance Tracker Application. GitHub Repository. Retrieved
from:
https://github.com/i-soumya18/Attendance-Tracker

27
Acknowledgement
We are profoundly grateful to Prof. Mohd Ashfaque Shaikh for his expert guidance and
continuous encouragement throughout to see that this project rights its target.

We would like to express deepest appreciation towards Dr. Varsha Shah, Principal RCOE,
Mumbai, Prof. Anupam Choudhary HOD of Computer Engineering Department and Prof.
Shiburaj Pappu Dean of Computer Engineering Department whose invaluable guidance
supported us in this project.

At last, we must express our sincere heartfelt gratitude to all the staff members of Computer
Engineering Department who helped us directly or indirectly during this course of work.

28

You might also like