Attendance Compliance Agent

A fully functional FastAPI-based attendance tracking system compliant with VFSTR R22 regulations. It handles session scheduling, attendance percentage calculations, On-Duty (OD) leave workflows, condonation processing, holiday calendar integration, and report generation in JSON/CSV/XLSX formats.

Quick Start

pip install -r requirements.txt
uvicorn app.main:app --reload

Open http://localhost:8000/docs for interactive API documentation.

Project Structure

attendance_agent/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py                    # FastAPI entry point
β”‚   β”œβ”€β”€ models.py                  # SQLAlchemy ORM models + SQLite
β”‚   β”œβ”€β”€ attendance_calculator.py   # Attendance % logic with R22 rules
β”‚   β”œβ”€β”€ timetable.py               # Slot & session management
β”‚   β”œβ”€β”€ holidays.py                # Holiday calendar integration
β”‚   β”œβ”€β”€ od_workflow.py             # Facultyβ†’HOD OD approval chain
β”‚   β”œβ”€β”€ condonation.py             # Condonation rules (65%/55% thresholds)
β”‚   β”œβ”€β”€ report.py                  # JSON, CSV, XLSX report exports
β”‚   └── routers/
β”‚       β”œβ”€β”€ students.py            # Student CRUD
β”‚       β”œβ”€β”€ subjects.py            # Subject CRUD
β”‚       β”œβ”€β”€ timetable_routes.py    # Timetable & session endpoints
β”‚       β”œβ”€β”€ attendance.py          # Mark attendance & calculate %
β”‚       β”œβ”€β”€ od_routes.py           # OD request/approval APIs
β”‚       β”œβ”€β”€ condonation_routes.py  # Condonation APIs
β”‚       β”œβ”€β”€ holidays_routes.py     # Holiday APIs
β”‚       └── reports_routes.py      # Report generation APIs
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_full.py               # 27 comprehensive unit tests
β”‚   └── integration_test.py        # End-to-end integration test
└── requirements.txt

Core Features

Attendance Calculation

  • Formula: Attended Sessions / Total Sessions Γ— 100
  • Excludes holidays automatically
  • OD counts as present after approval
  • Handles Lecture (L), Tutorial (T), Practical (P) session types

VFSTR R22 Rules

Percentage Status
β‰₯ 75% Eligible
65–74% First condonation (with fee)
55–64% Second condonation (if first approved)
< 55% Not eligible / repeat course

Session Management

  • Timetable slots define weekly recurring schedules
  • Sessions auto-generated for dates matching slots
  • No duplicates generated
  • Holiday dates skip session creation

OD Workflow

Student Request β†’ Faculty Review β†’ HOD Approval β†’ Attendance Updated

Report Types

  • Daily Attendance β€” per-session records
  • Subject-wise Summary β€” % per student per subject
  • Monthly Report β€” attendance trends
  • Defaulter Report β€” students below 75%
  • OD/Condonation Report β€” pending and processed requests

Export Formats

  • JSON (default)
  • CSV
  • XLSX (Excel)

Testing

# Unit tests (27 tests)
pytest tests/test_full.py -v

# Integration test (requires server running)
python tests/integration_test.py

API Endpoints

Feature Endpoint
Health GET /health
Students POST /students/, GET /students/
Subjects POST /subjects/, GET /subjects/
Timetable Slots POST /timetable/slots, GET /timetable/slots
Generate Sessions POST /timetable/generate-sessions/{date}
Mark Attendance POST /attendance/mark
Calculate % POST /attendance/calculate
Defaulters GET /attendance/defaulters/{section}
OD Request POST /od/
OD Faculty Approval POST /od/{id}/approve-faculty
OD HOD Approval POST /od/{id}/approve-hod
Condonation POST /condonation/, POST /condonation/{id}/approve
Holidays POST /holidays/, GET /holidays/
Reports POST /reports/ (json/csv/xlsx)

Dependencies

  • FastAPI β‰₯ 0.110.0
  • SQLAlchemy β‰₯ 2.0.0
  • Pydantic β‰₯ 2.6.0
  • openpyxl β‰₯ 3.1.0
  • pytest β‰₯ 8.0.0

Generated by ML Intern

This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "balaji958685/attendance-compliance-agent"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

For non-causal architectures, replace AutoModelForCausalLM with the appropriate AutoModel class.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support