π Introduction
Managing student leaves manually can be tedious. What if we could automate the process of sending warning emails when students exceed a set leave limit? π€
That's exactly what I builtβa CLI-based Student Leave Warning System using Python and SMTP! This project helps track student leaves and automatically sends a warning email if the leave count exceeds 3.
π§ Features of the Project
β
Simple Command Line Interface (CLI) for student input.
β
Automatically sends an email if leave count > 3.
β
Uses SMTP (Simple Mail Transfer Protocol) for email notifications.
β
Easily customizable and extendable.
βοΈ How It Works
1οΈβ£ User Input (CLI-Based)
When the script runs, the student is prompted to enter:
Name
Subject
Total Leaves Taken
2οΈβ£ Checking Leave Count
If the leave count exceeds 3, the program triggers an email warning.
3οΈβ£ Sending an Email (SMTP)
Using Python's smtplib, the script sends an email to the student's registered email.
π© Example Email:
pgsql
Copy
Edit
Subject: Leave Warning Notification
Dear [Student Name],
You have exceeded the allowed leave limit (3). Please ensure attendance compliance.
Regards,
Admin
π Getting Started
1οΈβ£ Clone the Repository
bash
Copy
Edit
2οΈβ£ Install Dependencies
Ensure Python is installed and install required libraries:
bash
Copy
Edit
pip install smtplib
3οΈβ£ Configure SMTP Settings
Modify the script to use your email credentials:
python
Copy
Edit
EMAIL_ADDRESS = "your-email@gmail.com"
EMAIL_PASSWORD = "your-app-password"
β οΈ Tip: Use an App Password instead of your actual password for security.
4οΈβ£ Run the Program
bash
Copy
Edit
python main.py
π‘ Future Improvements
πΉ Store leave records in a database.
πΉ Add a GUI interface for better user interaction.
πΉ Enable multiple email provider support.
π GitHub Repository
Check out the complete source code on GitHub:
π https://github.com/abhinandan2540/My-PyNakama/tree/main/CLI_Attendence
π Final Thoughts
This project showcases how Python can automate repetitive tasks like sending email notifications. Whether you're a student, teacher, or developer, this project is a great way to explore Python automation with SMTP.
Let me know your thoughts! What features would you add? Comment below! ππ₯
Top comments (0)