Track employee attendance, generate summaries, and flag attendance anomalies.
import pandas as pd
from datetime import datetime, timedelta
def attendance_summary(dept_id, period_days=30):
cutoff = datetime.now() - timedelta(days=period_days)
records = pd.read_sql("SELECT * FROM attendance WHERE dept_id = ? AND date >= ?", (dept_id, cutoff))
summary = records.groupby('staff_id').agg(total_days=('date','count'), present=('status',lambda x: (x=='present').sum()))
summary['rate'] = (summary['present'] / summary['total_days'] * 100).round(1)
return summaryBasic Package
Special SME traction programme by AINNA.
Limited starter website offer. AI usage, hosting, maintenance and custom integrations depend on the confirmed scope.
View SME Offer β
Ask about AINNA pages, services and articles.
AINNA website sources only Β· answers up to 5 lines
No section data available yet.
Sites with documented sections will appear here.
We value your privacy
We use browser storage to remember your choice. Optional analytics runs only after you allow it; your choice is recorded with an anonymous ID. Privacy Policy