ZKTeco Biometric Attendance & SMS Notification System (Python)
by Samuel

About this product
Tired of building attendance systems from scratch? This is a complete, professional-grade solution that bridges the gap between ZKTeco hardware and real-world school needs. We've spent hundreds of hours solving all the complex edge cases so you don't have to. This system is not just a simple script; it's a fully automated, multi-process backend service designed for stability and reliability. It's currently deployed in a real-world boarding school environment, handling thousands of logs without issue.
System Overview and Value Proposition
This system provides a finished product that can be deployed in hours, not months, offering professional parent notification capabilities that enhance student safety and accountability. For schools, it automates manual work by eliminating the need for staff to manually check logbooks and call parents. For freelance developers and integrators, it serves as a business-in-a-box solution that can be rebranded and sold to multiple schools, providing a robust backend foundation for more advanced school management systems.
Technical Components and Architecture
The complete package includes a fully commented Python script (zkteco.py), batch scripts for starting and stopping services, a VBS script for background operation, and SQL setup files for MySQL database creation. The system features multi-process architecture with concurrent database access, Access DB file handling, stateful logic management, and robust error handling. All complex technical challenges have been solved, including multi-threading vs. multi-processing architecture decisions.
Requirements and Setup
Requires a Windows machine (adaptable for Linux), XAMPP or similar web server stack with MySQL, Python 3.x with included requirements.txt file. Key libraries include pyzk, pyodbc, mysql-connector-python, and openpyxl. Hardware requirements include one or more ZKTeco biometric devices accessible on the network, ZKTime 5.0 software installation for Access DB user information, and a Sematime account for SMS functionality.
Documentation and Support
Since this is a backend service, traditional live preview isn't feasible. Instead, the package provides full commented source code for review, screenshots of folder structure and log file output, generated Excel reports, central MySQL database views, and a comprehensive README.md file guiding through every step of installation and configuration.
Key Features
Direct Device Integration: Connects directly to ZKTeco devices using the pyzk library.
Real-Time Polling: Runs as a persistent background service, checking for new attendance logs every few seconds.
Accurate IN/OUT Logic: Intelligently interprets the device's punch code (0 for Check-In, 1 for Check-Out) to accurately determine the action. This is far more reliable than state-toggling logic.
Multi-Device Architecture: The system is designed to run one isolated Python process per device, preventing a single failing device from crashing the entire system. Management scripts (start_all, stop_all) are included.
Automatic SMS Notifications: Seamlessly integrates with the Sematime API to send instant, personalized SMS alerts to parents or guardians.
Central MySQL Database: All records are stored in a structured SQL database for easy reporting and building a future web UI.
Local Excel Reports: Each device script automatically generates its own daily Excel log for simple, offline access.
Robust Error Handling: The script is wrapped in extensive try...except...finally blocks. It will handle network timeouts and device freezes gracefully without crashing, logging the error and automatically retrying.
Detailed Logging: Creates comprehensive, rotating log files for each device, making troubleshooting and monitoring a breeze.
Easy Configuration: All key parameters (device IPs, database credentials, API keys) are located at the top of the script for easy setup.
Changelog
New Feature
- Initial release
Standard License
There is no additional charge for updates. You can continue to download the latest version for free.
Refer & Earn 10% New
Share with friends and earn commission on their purchases.

Samuel
Achievements

