Skip to content

zakariaelharrak/ofpptemploidetemp

Repository files navigation

OTS V1

Every end of the week, we receive our class schedule in the form of a PDF uploaded to a Dropbox folder. We receive this link as an announcement on the school's Facebook page.

The process seems simple: enter the school's Facebook page, check for the latest post, enter the link, and search for your class schedule among more than 15 classes. However, the issue arises when we can't download the schedule PDF without having other classes' schedules. Additionally, attempting to screenshot the schedule results in a blurry image. Furthermore, while trying to obtain the schedule, I may become confused with other posts on Facebook, leading to a loss of focus for an hour or more.

For these reasons, I thought, "Why not create a Python script alongside a webpage to solve this issue for me?"

image

Problem

So... to solve this issue, I need to address these technical issues:

  • I need to crop each PDF based on the timetable table. (Note: Some pages contain 2-3 tables.)
  • I need to organize and rename each PDF automatically with the class name.
  • I need to redesign this script in an interactive way, allowing users to select their class and access their school timeline in fewer than 3 clicks.
  • Finally, I want to deploy this solution using Azure web services to make it live.
  • Soulotion

    For the first issue, I experimented with various Python packages and settled on PyMuPDF. I implemented a method to split each PDF into three sections, each with a height of 250px. This resulted in a list of split PDFs, each dedicated to a single class.

    Addressing the second issue, I utilized a variety of packages to first open all the PDFs and analyze them to search for the class names. Finally, the script renamed each PDF with its corresponding class name.

    Subsequently, I developed a straightforward webpage featuring an option input containing all the class names (extracted from the PDFs resulting from splitting the main school schedule PDFs). I integrated a simple logic so that whenever a student selects one of the options (class names), their schedule is displayed using Flask.

    ots (1)

    Finally, for the last step of making this solution live, I deployed it using Azure web services. I installed necessary packages and executed the planned deployment, and everything functioned as intended.

    https://ofpptemploidetemp.azurewebsites.net/

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published