From da1ed119272d575a9b11c9f81255695ac3960689 Mon Sep 17 00:00:00 2001 From: Khushal P Soonderji Date: Mon, 19 Jan 2026 16:07:28 +0530 Subject: [PATCH] (20260119) Instructions updated to show how to run the scripts, and convenient bash scripts added. --- README.md | 20 ++++++++++++++------ run.sh => run_api.sh | 0 run_cron.sh | 10 ++++++++++ run_manual_attendance.sh | 12 ++++++++++++ 4 files changed, 36 insertions(+), 6 deletions(-) rename run.sh => run_api.sh (100%) create mode 100644 run_cron.sh create mode 100644 run_manual_attendance.sh diff --git a/README.md b/README.md index 301ec4f..229f41c 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,6 @@ Alternately, you can receive a well-structured JSON dump of the known good versi ![Chrome Driver Download Page Screenshot](assets/images/chrome_driver_download_page.png) -Chrome Driver Download Page Screenshot - ### 👉 Where To Place The Drivers Matrix refused to give APIs for accessing data from their Cosec system. Selenium is being used for web browser automation as a solution. We chose Chrome as the web browser for this since it is very widely available and most supported by a huge margin. @@ -102,10 +100,20 @@ You can check the version of Chrome on your device by going to `Settings` 👉 ` ![Chrome Version Check Screenshot](assets/images/chrome_version_check.png) -Chrome Version Check Screenshot - --- -## Cron-Based Automation +## Running The Scripts -Automation of attendance has been done in a cron-like fashion where activities happen at scheduled times. \ No newline at end of file +**⚠️ NOTE:** Ensure that the virtual environment is activated before running the Python script. The `.sh` files enable the virtual environment automatically, you need not worry when running them. + +### 👉 Running APIs That Are Called From TCAOFF's Frontend + +Run the file `/backend/api/main.py`, or `/run_api.sh` + +### 👉 Running The Cron SCript That Fetches Reports Periodically + +Run the file `/cron/reports.py`, or `/run_cron.sh` + +### 👉 Running The Manual Attendance Script + +Run the file `/cron/attendance.py` with the args `--date `, or run `/run_cron.sh` and it will prompt you to type the date. \ No newline at end of file diff --git a/run.sh b/run_api.sh similarity index 100% rename from run.sh rename to run_api.sh diff --git a/run_cron.sh b/run_cron.sh new file mode 100644 index 0000000..a7e3f4c --- /dev/null +++ b/run_cron.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Use this to run the microservice without any docker setup. +source .venv/bin/activate +python3 "$(pwd)/cron/reports.py" +deactivate + +# All done: +echo "Done!" +exit 0 \ No newline at end of file diff --git a/run_manual_attendance.sh b/run_manual_attendance.sh new file mode 100644 index 0000000..ec0b7dc --- /dev/null +++ b/run_manual_attendance.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Use this to run the microservice without any docker setup. +source .venv/bin/activate +echo "Enter a target date (in yyyy-mm-dd format):" +read date +python3 "$(pwd)/cron/attendance.py" --date "$date" +deactivate + +# All done: +echo "Done!" +exit 0 \ No newline at end of file