A Windows desktop middleware application that connects to a ZKTeco biometric attendance device, fetches attendance logs, maps them to ERPNext Employee Checkin, and syncs records using ERPNext REST API.
src/— application source modulesconfig/settings_example.json— sample local configurationdb/schema.sql— SQLite database schemarequirements.txt— Python dependenciesREADME.md— setup and usage guide
- Connects to ZKTeco device over LAN (TCP/IP)
- Fetches fingerprint and face attendance logs
- Converts logs for ERPNext
Employee Checkin - Supports device user → ERPNext employee mapping
- Avoids duplicate records using local SQLite storage
- Retries failed syncs and caches offline logs
- Simple PyQt5 desktop UI with status/log panel
- Optional REST API server for remote control
- Install Python 3.10+ on Windows.
- Open PowerShell in the project folder.
- Create a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt- Copy sample configuration:
copy config\settings_example.json settings.json- Edit
settings.jsonwith your device details and ERPNext credentials. - Run the desktop app:
python src\main.py- Install the application dependencies and PyInstaller:
py -3.14 -m pip install --upgrade pip
py -3.14 -m pip install PyQt5 requests Flask python-dateutil
py -3.14 -m pip install pyinstallerIf you need ZKTeco device communication, also install the zk package:
py -3.14 -m pip install zkNote:
zkmay require Microsoft C++ Build Tools on Windows.
- Build the executable manually:
py -3.14 -m PyInstaller --onefile --windowed --paths src src\main.py --name "ZKTecoERPNextSync"- Or run the helper script:
build_exe.bat- The executable will be in
dist\ZKTecoERPNextSync.exeandsettings.jsonwill be copied next to it.
If you have NSIS installed, run:
build_installer.batThis uses installer.nsi to build ZKTecoERPNextSyncInstaller.exe.
The database stores cached device logs, synced records, and sync metadata. See db/schema.sql.
If you want remote status or an HTTP trigger for sync, run:
python src\api_server.pyThen use these endpoints:
GET /api/healthPOST /api/syncGET /api/configPOST /api/configGET /api/logs
- Ensure your ERPNext site has
Employeerecords that can be matched to the device user IDs. - If your ERPNext
Employeedoctype uses a custom biometric field, update the matching logic insrc/erpnext_client.py. - The project is designed to be extendable for multi-device support and service startup integration.