-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
6,041 additions
and
19,258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
omit = | ||
pyzkaccess/cli.py | ||
setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,80 @@ | ||
# PyZKAccess | ||
|
||
 | ||
 | ||
 | ||
[](https://pypi.org/project/pyzkaccess/) | ||
[](https://pypi.org/project/pyzkaccess/) | ||
[](https://travis-ci.com/github/bdragon300/pyzkaccess) | ||
[](https://codecov.io/gh/bdragon300/pyzkaccess) | ||
 | ||
[](https://github.com/bdragon300/pyzkaccess/blob/master/LICENSE) | ||
|
||
**PyZKAccess** is a library for working with ZKTeco ZKAccess C3-100/200/400 access controllers. | ||
**PyZKAccess** is a library and command-line interface for working with ZKTeco ZKAccess | ||
C3-100/200/400 access controllers. | ||
|
||
[Read documentation](https://bdragon300.github.io/pyzkaccess) | ||
|
||
# Quick start | ||
|
||
First, you need to install ZKTeco PULL SDK. See documentation for more info. | ||
|
||
In order to make requests to your C3 device, you need to know its IP address. Let's scan a | ||
local network and find a device: | ||
|
||
```console | ||
$ 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 | | ||
+---------------+-------------------+--------+---------------------+--------------------------+ | ||
``` | ||
|
||
Now you can connect to a device using its IP and, for example, print list of all Users: | ||
|
||
```console | ||
$ 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 select only needed records: | ||
|
||
```console | ||
$ 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 | | ||
+----------+------------+-------+----------+-----+------------+-----------------+ | ||
``` | ||
|
||
Also, you can update or delete records from a csv file. Or even delete all records from a query: | ||
|
||
```console | ||
$ 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: | ||
|
||
```console | ||
$ 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: | ||
|
||
```console | ||
$ 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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
theme: jekyll-theme-minimal | ||
baseurl: 'pyzkaccess' | ||
url: 'https://bdragon300.github.io' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Command-line interface | ||
|
||
CLI interface uses command/subcommand chain approach. Typical CLI usage is: | ||
|
||
Commands for a connected device: | ||
|
||
```console | ||
$ pyzkaccess connect <ip> <subcommand|group> [parameters] [<subcommand> [parameters] ...] | ||
``` | ||
|
||
* Commands not related to a particular device: | ||
```console | ||
$ pyzkaccess <command> [parameters] | ||
``` | ||
|
||
By default, all input consumes from stdin, and all output prints on stdout. You can specify a file | ||
instead by setting `--file` parameter. | ||
|
||
CLI gives access to most of PyZKAccess features. Also, it is supported the ascii tables in console | ||
or CSV format. | ||
|
||
Every command, group and subcommand has its own help contents, just type them and append | ||
`--help` at the end. For example, here is the help for `connect` command: | ||
|
||
```console | ||
$ pyzkaccess connect --help | ||
``` | ||
|
||
Or for `where` subcommand of `table` subcommand: | ||
|
||
```console | ||
$ pyzkaccess connect 192.168.1.201 table User where --help | ||
``` |
Oops, something went wrong.