Skip to main content

PyZKAccess

version pyversions GitHub Actions Workflow Status codecov license

PyZKAccess is a library and command-line interface for working with ZKTeco ZKAccess C3-100/200/400 access controllers.

This package is Windows-only, but it can be used on *nix systems with Wine. It built on top of the ZKTeco PULL SDK and fully supports all its features.

This package, once installed, may be used as library for your project or command-line interface. It's also distributed as a portable Windows executable, created by PyInstaller with built-in 32-bit Python interpreter.

Read documentation

Features

We support all the features the ZKTeco PULL SDK provides:

  • Can be used as a code library or a command-line tool
  • Reading and writing the device data tables
  • Making queries to device data tables
  • CSV format support
  • On-board relays control
  • Read the realtime events of a particular reader, aux input, door or the whole device
  • Manipulation the device parameters such as datetime, network settings, entry modes, backup time, etc.
  • Manipulation the door parameters such as smart card modes, intervals, entry modes, etc.
  • Restart a device
  • Scan the local network for active C3 devices
  • Download/upload files from PC to/from a device
  • Cancel alarm function
  • Reset the device IP address by its MAC address

Quick start

The quickest way is to use portable pyzkaccess.exe. It contains the full pyzkaccess package with built-in Python and necessary libraries.

You can also install the package from PyPI (the 32-bit Python>=3.9 version is required) pip install pyzkaccess

Run this to setup the environment:

pyzkaccess setup

This command will make a quick compatibility check of your system and suggest you to install PULL SDK from the official ZKTeco site (you can also specify your own SDK archive or you can install SDK manually, see docs for more info).

pyzkaccess setup

All set! Now let's find out what ZKAccess devices are available on the local network:

$ pyzkaccess search_devices
+---------------+-------------------+--------+---------------------+--------------------------+
| ip            | mac               | model  | serial_number       | version                  |
+---------------+-------------------+--------+---------------------+--------------------------+
| 192.168.1.201 | 00:17:61:C3:BA:55 | C3-400 | DGD9190010050345332 | AC Ver 4.3.4 Apr 28 2017 |
+---------------+-------------------+--------+---------------------+--------------------------+

Let's enumerate all users registered on a device:

$ pyzkaccess connect 192.168.1.201 table User
+----------+------------+-------+----------+-----+------------+-----------------+
| card     | end_time   | group | password | pin | start_time | super_authorize |
+----------+------------+-------+----------+-----+------------+-----------------+
| 16268812 | 2020-12-01 | 2     | 123456   | 1   | 2020-06-01 | 1               |
| 16268813 |            | 3     | 123451   | 3   |            | 0               |
+----------+------------+-------+----------+-----+------------+-----------------+

Or print a particular one:

$ pyzkaccess connect 192.168.1.201 table User where --card=16268812
+----------+------------+-------+----------+-----+------------+-----------------+
| card     | end_time   | group | password | pin | start_time | super_authorize |
+----------+------------+-------+----------+-----+------------+-----------------+
| 16268812 | 2020-12-01 | 2     | 123456   | 1   | 2020-06-01 | 1               |
+----------+------------+-------+----------+-----+------------+-----------------+

Adding, updating, or deleting records from a device table:

$ cat users1.csv | pyzkaccess --format=csv connect 192.168.1.201 table User upsert
$ cat users2.csv | pyzkaccess --format=csv connect 192.168.1.201 table User delete
$ pyzkaccess connect 192.168.1.201 table User --card=16268812 delete_all

Switching relays and awaiting device events:

$ pyzkaccess connect 192.168.1.201 relays switch_on
$ pyzkaccess connect 192.168.1.201 events --event_type=23 poll
           card door     entry_exit     event_type  pin                     time    verify_mode
       16268813    1              0             23    3      2020-05-09 22:35:55              0

Getting and setting parameters:

$ pyzkaccess connect 192.168.1.201 parameters --names=ip_address,serial_number,datetime
+---------------------+---------------+---------------------+
| datetime            | ip_address    | serial_number       |
+---------------------+---------------+---------------------+
| 2020-05-09 22:42:31 | 192.168.1.201 | DGD9190010050345332 |
+---------------------+---------------+---------------------+
$ pyzkaccess connect 192.168.1.201 parameters set --datetime='2020-05-09 22:42:31' --rs232_baud_rate=57600

Metadata

Release files for pyzkaccess 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyzkaccess 1.2
File Size Uploaded
pyzkaccess-1.2.tar.gz 63.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyzkaccess 1.2
File Interpreter ABI Platform
pyzkaccess-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 133.1 kB

Release files / pyzkaccess-1.2.tar.gz

Download URL pyzkaccess-1.2.tar.gz
Size 63.6 kB
Tags Source
SHA-256 checksum
How to use checksums
31d65ac62bee11d96456706b10f9d8e48447be4cec60c4f3ea4c4ad01877d3e3
BLAKE2b-256 checksum
How to use checksums
b54b425d0df08c88f6d685d8bf8a30bf75c0ab59076d3f081343d42b0441b186
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.9.25 Linux/6.17.0-1022-azure

Release files / pyzkaccess-1.2-py3-none-any.whl

Download URL pyzkaccess-1.2-py3-none-any.whl
Size 69.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b1a05b0be602947cbce9a64376276783002fc910626b3083070d72c22ac34ec
BLAKE2b-256 checksum
How to use checksums
7649d5f9da5a377ef79351e99d9545333a30ed0a6ef30a3a47e4f3a307e6a9aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.9.25 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

2 release files

1.0

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page