(20260119) Instructions updated to show how to run the scripts, and convenient bash scripts added.

This commit is contained in:
2026-01-19 16:07:28 +05:30
parent 62504963b5
commit da1ed11927
4 changed files with 36 additions and 6 deletions
+14 -6
View File
@@ -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](assets/images/chrome_driver_download_page.png)
<img src="assets/images/chrome_driver_download_page.png" alt="Chrome Driver Download Page Screenshot" style="width:100%; max-width:1000px; height:auto;">
### 👉 Where To Place The Drivers ### 👉 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. 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](assets/images/chrome_version_check.png)
<img src="assets/images/chrome_version_check.png" alt="Chrome Version Check Screenshot" style="width:100%; max-width:1000px; height:auto;">
--- ---
## Cron-Based Automation ## Running The Scripts
Automation of attendance has been done in a cron-like fashion where activities happen at scheduled times. **⚠️ 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 `<proj-dir>/backend/api/main.py`, or `<proj-dir>/run_api.sh`
### 👉 Running The Cron SCript That Fetches Reports Periodically
Run the file `<proj-dir>/cron/reports.py`, or `<proj-dir>/run_cron.sh`
### 👉 Running The Manual Attendance Script
Run the file `<proj-dir>/cron/attendance.py` with the args `--date <yyyy-mm-dd>`, or run `<proj-dir>/run_cron.sh` and it will prompt you to type the date.
View File
+10
View File
@@ -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
+12
View File
@@ -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