# Excel Structure Template

## File: `UDISE_Student_Master.xlsx`

This is the **master database file** containing all student records. Created automatically by `udise_student_manager.py`.

### Sheet 1: Basic_Info

| Column Name | Data Type | Example | Required? | Notes |
|-------------|-----------|---------|-----------|-------|
| UDISE_Code | Text | 24110206411 | Yes | 11-digit school code |
| Admission_No | Text | 2024001 | Yes | Unique per student |
| Name | Text | Rahul Kumar | Yes | Full name as per records |
| Father_Name | Text | Ramesh Kumar | Yes | |
| Mother_Name | Text | Sita Devi | Yes | |
| DOB | Date | 2008-05-15 | Yes | YYYY-MM-DD format |
| Gender | Text | Male | Yes | Male/Female/Other |
| Caste | Text | OBC | Yes | SC/ST/OBC/General |
| Category | Text | BC | No | Additional category |
| Aadhaar_No | Text | 123456789012 | No | 12 digits, no spaces |
| Mobile_No | Text | 9876543210 | No | 10 digits, no +91 |
| Email | Text | rahul@email.com | No | |
| Address | Text | 123 Main St, City | No | Full residential address |

**Row count:** One row per student

---

### Sheet 2: Academic

| Column Name | Data Type | Example | Required? | Notes |
|-------------|-----------|---------|-----------|-------|
| Admission_No | Text | 2024001 | Yes | Must match Basic_Info |
| Class | Text | 10 | Yes | 1-12 |
| Section | Text | A | Yes | A, B, C, D... |
| Roll_No | Integer | 23 | Yes | Unique within class |
| Medium | Text | Hindi | Yes | Hindi/English/Gujarati |
| Year | Text | 2024-25 | Yes | Academic session |
| Previous_School | Text | XYZ School, City | No | If transferred |
| Transfer_Certificate_No | Text | TC/2023/001 | No | |

**Row count:** One row per student (1:1 with Basic_Info)

---

### Sheet 3: Attendance

| Column Name | Data Type | Example | Required? | Notes |
|-------------|-----------|---------|-----------|-------|
| Admission_No | Text | 2024001 | Yes | Student ID |
| Month | Text | January | Yes | Full month name or number |
| Working_Days | Integer | 26 | Yes | Total days in month |
| Days_Present | Integer | 24 | Yes | |
| Days_Absent | Integer | 2 | Yes | Auto-calculated |
| Attendance_Pct | Float | 92.31 | Yes | Auto-calculated |

**Row count:** Multiple rows per student (one per month)

---

### Sheet 4: Fees

| Column Name | Data Type | Example | Required? | Notes |
|-------------|-----------|---------|-----------|-------|
| Admission_No | Text | 2024001 | Yes | Student ID |
| Fee_Type | Text | Tuition Fee | Yes | Tuition, Exam, Development, etc. |
| Amount | Float | 500.00 | Yes | Total amount due |
| Paid | Float | 500.00 | Yes | Amount paid |
| Due | Float | 0.00 | Yes | Auto-calculated (Amount - Paid) |
| Last_Payment_Date | Date | 2024-06-15 | No | |

**Row count:** Multiple rows per student (one per fee type)

---

## Additional Sheets (Auto-Generated by Processor)

### Class_5, Class_6, ... (one per class)
Same columns as Basic_Info, filtered by class.

### Gender_Male, Gender_Female
Same columns as Basic_Info, filtered by gender.

---

## Formatting Guidelines

### Date Format
- Use **YYYY-MM-DD** (ISO 8601) consistently
- Excel will display as DD/MM/YYYY if cell formatted as Date

### Phone Numbers
- Store as **text**, not numbers (preserves leading zeros)
- 10 digits only (no +91, no spaces)
- Example: `9876543210`

### Roll Numbers
- Integer type
- Unique within each class

### Attendance Percentage
- Formula in Excel: `= (Days_Present / Working_Days) * 100`
- Format as number with 2 decimal places

### Amount Fields
- Currency format (₹)
- 2 decimal places

---

## Validation Rules

1. **Admission_No** must be unique across all students
2. **Basic_Info** and **Academic** must have same count of rows
3. Attendance months must be valid month names
4. Due amount = Amount - Paid (enforce with formula)
5. Gender values standardised: Male/Female/Other only

---

## Backup Strategy

**Daily backup (manual):**
```bash
cp ~/UDISE_Data/UDISE_Student_Master.xlsx ~/Backup/UDISE_$(date +%Y%m%d).xlsx
```

**Weekly backup (cron):**
```
0 2 * * 0 cp /home/piyush/UDISE_Data/UDISE_Student_Master.xlsx /home/piyush/Backups/Weekly_$(date +\%Y\%m\%d).xlsx
```

---

## Template Download

Use this CSV for initial data entry if needed:

```csv
UDISE_Code,Admission_No,Name,Father_Name,Mother_Name,DOB,Gender,Caste,Category,Mobile_No,Class,Section,Medium
24110206411,2024001,Rahul Kumar,Ramesh Kumar,Sita Devi,2008-05-15,Male,OBC,BC,9876543210,10,A,Hindi
```

---

*This template reflects the output format of `school-records-automation` skill.*
