Spaces:
Build error
Build error
Download check_data.py from Huzaifa1313/AI-Attendance-System: direct link, hf CLI and curl.
- Browser
- Download file 627 Bytes
-
https://huggingface.co/spaces/Huzaifa1313/AI-Attendance-System/resolve/main/check_data.py
- Command line
-
hf download hf://spaces/Huzaifa1313/AI-Attendance-System/check_data.py
-
curl -L -o check_data.py https://huggingface.co/spaces/Huzaifa1313/AI-Attendance-System/resolve/main/check_data.py
627 Bytes
| from pymongo import MongoClient | |
| # MongoDB se connect karein | |
| # (Yahan wahi link dalein jo database.py mein hai) | |
| client = MongoClient("mongodb://localhost:27017/") | |
| db = client["AttendanceSystem"] | |
| collection = db["attendance"] | |
| # Saara data nikaalein | |
| print("--- Database mein mojood Attendance Records ---") | |
| records = collection.find() | |
| count = 0 | |
| for data in records: | |
| print(f"Naam: {data['name']} | Time: {data['time']} | Status: {data['status']}") | |
| count += 1 | |
| if count == 0: | |
| print("Database khali hai! Abhi tak koi attendance nahi lagi.") | |
| else: | |
| print(f"--- Total Records Found: {count} ---") |