DEV Community

Fahad Ali Khan
Fahad Ali Khan

Posted on

Finding My Footing in Open-Source Timesheet Automation

Blog Post 1: Progress Update

Introduction

A few days ago, I embarked on contributing to the Academic-Learning-Centre-Admin-Scripts—a Python project that automates the creation and maintenance of weekly timesheets. My ultimate goal was to add new features (like sending the updated Excel timesheets via email), improve documentation, and enhance the overall code quality. Along the way, I’ve also been juggling a heavy workload: I’m taking five other courses and actively preparing for internship interviews, which means every hour spent on this project needed to count.

Despite these constraints, I’ve made meaningful progress. This update reflects on what I’ve accomplished so far, the challenges I’ve tackled, and how I’ve measured my progress against my initial goals.

What I’ve Accomplished So Far

  1. Email Data Generation:

    I started by implementing emailDataGenerator, a function that returns a structured array of email details (recipient, subject, current date, formatted week range, and salutations). Creating this helped me understand Python’s datetime handling more deeply and forced me to pay attention to code structure.

  2. Integrating Email Sending Functionality:

    After generating data, I implemented sendEmail to actually dispatch emails. This involved using smtplib and email.message.EmailMessage to connect to an SMTP server, format the email, and send it out. The initial attempts led to some trial and error—authenticating with SMTP, managing credentials, and ensuring the email rendered correctly were all new challenges for me.

  3. Refactoring the Codebase:

    As I introduced new features, I realized the importance of clean, modular code. I refactored timesheet.py to break logic into smaller functions, used constants for configuration, and set up separate modules (email_generator.py, email_sender.py). This not only made the code more maintainable but also helped me clarify my own understanding of the workflow.

  4. Creating a User Guide (Planned):

    Although I haven’t fully finished this part, I’ve started outlining a USER_GUIDE.md that will describe how to deploy the project, configure it, and even schedule it to run automatically. The guide will be the next big step, ensuring that anyone can use or adapt this script without struggling through trial and error.

Challenges and Solutions

  1. Time Management:

    With five other courses on my plate and ongoing internship interviews, finding time for open-source contributions was tough. I overcame this by:

    • Setting small, achievable milestones each week.
    • Writing down what I accomplished in blog posts and PR comments, creating a record that motivated me to keep going.
  2. Technical Hurdles:

    • SMTP & Email Attachments: Understanding how to attach the Excel file and handle credentials took some research. I read through Python’s official docs and tested locally until the feature worked reliably.
    • Refactoring: Improving code structure required me to understand every part of the script. By separating logic into functions and modules, I can now navigate the code more easily and add new features without chaos.
  3. Open-Source Etiquette:

    I learned to write meaningful commit messages, describe PRs thoroughly, and make my branches and merges cleaner. While I haven’t had much direct feedback from maintainers yet, I’m preparing my contributions as if a reviewer is watching carefully.

Adjusting Course for the Final Release

Now that the emailing logic is in place and the code is refactored, I’m focusing on:

  • Finalizing the user guide with deployment instructions and examples.
  • Adding a weekly emailing schedule so that the admin office receives timesheets automatically every Monday (or another chosen day).
  • Polishing code style and ensuring I meet PEP 8 guidelines.

My final blog post will detail the completed features, what I learned, how close I came to my initial goals, and how I overcame time constraints.

Conclusion

I’m halfway through my planned tasks and feeling more confident than when I started. Working in Python after a year-long hiatus was challenging, but creating these features and writing about them has solidified my understanding. By my next update, I aim to have the project fully ready for others to adopt, with a user guide and a clean, professional codebase. Despite my busy schedule, I’m making steady, visible progress.

Top comments (0)