{"id":23156,"library":"pyzk","title":"pyzk","description":"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.","status":"active","version":"0.9","language":"python","source_language":"en","source_url":"https://github.com/fananimi/pyzk","tags":["zkteco","fingerprint","attendance","biometrics","access control"],"install":[{"cmd":"pip install pyzk","lang":"bash","label":"Install latest release"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"ZK","correct":"from pyzk import ZK"}],"quickstart":{"code":"from pyzk import ZK\n\nconn = None\nzk = ZK('192.168.1.201', port=4370, timeout=5, password=0, force_udp=False, verbose=True)\ntry:\n    conn = zk.connect()\n    print('Connected:', conn)\n    print('Device info:', zk.get_device_info())\n    users = zk.get_users()\n    for user in users:\n        print(user)\n    attendances = zk.get_attendance()\n    for att in attendances:\n        print(att)\nexcept Exception as e:\n    print('Error:', e)\nfinally:\n    if conn:\n        conn.disconnect()","lang":"python","description":"Connects to a ZKTeco device, prints device info, users, and attendance records."},"warnings":[{"fix":"Use port 4370 unless you know your device uses a different one.","message":"The default port for pyzk is 4370, but many ZKTeco devices use port 4370 or 4371. Double-check your device configuration.","severity":"gotcha","affected_versions":"all"},{"fix":"Test with your specific device model. If it fails, consider using the official ZKTeco SDK or binary protocol libraries like zkteco.","message":"The library uses a proprietary protocol. Not all ZKTeco models are supported; some newer devices may not work.","severity":"gotcha","affected_versions":"all"},{"fix":"Update your code to access properties on Attendance objects instead of indexing tuples.","message":"In 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.","severity":"breaking","affected_versions":">=0.9"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Verify network connectivity (ping), correct IP and port, and that the device is powered on. Try setting force_udp=True or verbose=True for debugging.","cause":"Device unreachable, wrong IP/port, or firewall blocking.","error":"pyzk.core.ZKError: Unable to connect to device"},{"fix":"Ensure your device is a ZKTeco model that uses the standard protocol. Try upgrading the device firmware or use an alternative library.","cause":"Protocol mismatch or unsupported device model.","error":"pyzk.core.ZKError: Device communication error"},{"fix":"Always call connect() first and keep the connection open. For old versions, check the methods available: use get_user() with a specific user ID.","cause":"Trying to call get_users() after calling get_device_info() when not connected or using a very old version.","error":"AttributeError: 'ZK' object has no attribute 'get_users'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}