How frappe/biometric-attendance-sync-tool works
This tool polls biometric attendance devices and sends attendance records to ERPNext. Users can configure and run it through a GUI, the CLI loop, or a Windows service. The main sync routine schedules polling, retries saved dumps, filters records using prior successes and an import start date, then pushes punches; it also supports Shift Type synchronization. The excerpts show the core calls, but do not expose every device-processing detail, so unverified integrations are omitted.
Main entry points: erpnext_sync.py Sync scheduler · gui.py Configuration GUI · erpnext_sync_win.py Windows service wrapper · local_config.py.template Runtime configuration
Components 15
User entry points
- Configuration GUI
gui.py - CLI sync loop
erpnext_sync.py - Windows service wrapper
erpnext_sync_win.py - Windows service base
SMWinservice.py
Sync runtime
- Runtime configuration
local_config.py.template - Sync scheduler
erpnext_sync.py - Device attendance pull
erpnext_sync.py - Punch filtering and mapping
erpnext_sync.py - ERPNext attendance push
erpnext_sync.py - Shift Type sync
erpnext_sync.py
State and logs
- Sync status store
erpnext_sync.py - Attendance and activity logs
erpnext_sync.py
External systems
- Biometric attendance device
- ERPNext instance
Other components
- Operator
Connections 19
- Operator → Configuration GUI: configures and starts
README.md - Operator → CLI sync loop: runs sync
README.md - Operator → Windows service wrapper: installs service
README.md - Configuration GUI → Runtime configuration: writes configuration
gui.py - Configuration GUI → CLI sync loop: starts subprocess
gui.py - Windows service wrapper → Windows service base: inherits service framework
erpnext_sync_win.py - Windows service wrapper → Sync scheduler: calls main
erpnext_sync_win.py - CLI sync loop → Sync scheduler: calls main
erpnext_sync.py - Sync scheduler → Runtime configuration: reads settings
erpnext_sync.py - Sync scheduler → Sync status store: reads and updates
erpnext_sync.py - Sync scheduler → Device attendance pull: processes configured devices
erpnext_sync.py - Sync scheduler → Shift Type sync: updates shift timestamps
erpnext_sync.py - Sync scheduler → Attendance and activity logs: reads retry dumps
erpnext_sync.py - Device attendance pull → Biometric attendance device: fetches attendance
erpnext_sync.py - Device attendance pull → Punch filtering and mapping: passes attendance records
erpnext_sync.py - Punch filtering and mapping → Attendance and activity logs: reads last success
erpnext_sync.py - Punch filtering and mapping → ERPNext attendance push: submits mapped punches
erpnext_sync.py - ERPNext attendance push → ERPNext instance: posts attendance
erpnext_sync.py - Shift Type sync → ERPNext instance: updates shift records
erpnext_sync.py