Registry / communication / pyzk
library0.9pypypi✓ verified 82d ago

An unofficial Python library for interacting with ZKTeco fingerprint devices (attendance machines, access control). Version 0.9 is the latest stable release; development appears slow with no recent updates. The library supports TCP/IP communication and provides basic operations like connect, disconnect, get/set user data, and read real-time logs.

pip install pyzk
INSTALL
IMPORT
SIG · PYZK
P
pyzk
communicationpythonv0.9
Install
2.7s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 24MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ZK
from zk import ZK
from pyzk import ZK

Connects to a ZKTeco device, prints device info, users, and attendance records.

from pyzk import ZK conn = None zk = ZK('192.168.1.201', port=4370, timeout=5, password=0, force_udp=False, verbose=True) try: conn = zk.connect() print('Connected:', conn) print('Device info:', zk.get_device_info()) users = zk.get_users() for user in users: print(user) attendances = zk.get_attendance() for att in attendances: print(att) except Exception as e: print('Error:', e) finally: if conn: conn.disconnect()
Debug
Known issues
gotchaThe default port for pyzk is 4370, but many ZKTeco devices use port 4370 or 4371. Double-check your device configuration.
fix
Use port 4370 unless you know your device uses a different one.
affects: all
gotchaThe library uses a proprietary protocol. Not all ZKTeco models are supported; some newer devices may not work.
fix
Test with your specific device model. If it fails, consider using the official ZKTeco SDK or binary protocol libraries like zkteco.
affects: all
breakingIn older versions (pre-0.9), the method get_attendance() returned a list of tuples. In 0.9, it returns a list of Attendance objects with attributes like .user_id, .status, .timestamp.
fix
Update your code to access properties on Attendance objects instead of indexing tuples.
affects: >=0.9
Upgrade
Version history
0.9latest on PyPI · released Aug 13, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources