pyzkfp


Namepyzkfp JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/alqasemy2020/pyzkfp
SummaryA Python wrapper library for ZKFinger fingerprint scanner software.
upload_time2023-11-30 20:23:50
maintainer
docs_urlNone
authorAmjed Alqasemi
requires_python>=3.6
licenseGPLv3
keywords python fingerprint scanner wrapper library zkteco zkfinger zkfp zklib zkaccess zktime
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyzkfp


[![PyPI version](https://badge.fury.io/py/pyzkfp.svg)](https://badge.fury.io/py/pyzkfp)

## Overview
Because ZKTeco offical SDKs suck and are unstable and full of bugs, I decided to make a simple python wrapper library of their SDKs and save you from the agony of using their products.

## Why?
why not?

## Compatibility
This library can connect to `SLK20R` and ZK series, including `ZK9500`, `ZK6500`, `ZK8500R` devices.
 
## Installation
- You have to first install the ZKFinger SDK from the offical website [here](https://www.zkteco.com/en/Biometrics_Module_SDK/ZKFinger-SDK-for-Windows) or through this direct [link](https://new-website-file.s3.ap-southeast-1.amazonaws.com/files/20220725/9774a946c3f659ddf2ae90bc8dadc3eb.rar) (might stop working) 
- Then install this library via pip:
    ```bash
    pip install pyzkfp
    ```

## Features
- Initialize and interact with ZKFinger Reader devices.
- Capture fingerprint images.
- Perform fingerprint 1:1 comparisons.
- Perform fingerprint 1:N comparisons.
- Register and identify users.
- Light & Beep control functions.

## Usage
Here's a simple example of how to use this library:

#### Initialize the ZKFP2 class and open the device
```python
from pyzkfp import ZKFP2

# Initialize the ZKFP2 class
zkfp2 = ZKFP2()
zkfp2.Init()

# Get device count and open first device
device_count = zkfp2.GetDeviceCount()
logger.info(f"{device_count} Devices found, Connecting to the first device.")
zkfp2.OpenDevice(0)
```

### Capture a fingerprint
```python
while True:
    capture = zkfp2.AcquireFingerprint()
    if capture:
        # Implement your logic here
        break
```

### Perform a 1:N comparison
```python
tmp, img = capture
finger_id, score = zkfp2.DBIdentify(tmp)
```

### Perform a 1:1 comparison
```python
res = zkfp2.DBMatch(template1, template2) # returns 1 if match, 0 if not
```

### Register a fingerprint
In order to register a fingerprint, we must collect 3 templates from the same finger. And then we can merge them into one template and store it in the device's database.
```python
templates = []
for i in range(3):
    while True:
        capture = zkfp2.AcquireFingerprint()
        if capture:
            print('fingerprint captured')
            tmp, img = capture
            templates.append(tmp)
            break
regTemp, regTempLen = zkfp2.DBMerge(*templates)

# Store the template in the device's database
finger_id = 1 # The id of the finger to be registered
zkfp2.DBAdd(finger_id, regTemp)
```

### Storing and Loading Templates from an External Database for Future Use

Given that the device's memory clears upon shutdown, this step is crucial for preserving data. You have the option to store `regTemp` (the final result of the the three merged templates) in your preferred database to retrieve them for later use. The segment of code responsible for loading the registered templates from the database to the device's memory should be run after the device's initialization. Here is a simple way to do it.

```python

members = ... # load members' `regTemp` and their corresponding fingerPrintId from your database.

for member in members:
    fid, temp = member
    zkfp2.DBAdd(fid, temp)
    ...  
```


### To turn on/off the light
```python
zkfp2.Light('green') # green/red/white
```

### Terminate the device and release resources
```python
zkfp2.Terminate()
```

For more detailed usage instructions, please refer to the example folder (WIP).

## Support My Work
If you found this project useful, please hire a private investigator to legally blackmail ZKTeco's dev team, as this would really help spread the good word of this repository.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alqasemy2020/pyzkfp",
    "name": "pyzkfp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "python,fingerprint,scanner,wrapper,library,zkteco,zkfinger,zkfp,zklib,zkaccess,zktime",
    "author": "Amjed Alqasemi",
    "author_email": "alqasemy2020@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4b/ef/bda42448359dc36d37d07da2daea690a7ac607f64f46144659f992def25a/pyzkfp-0.1.5.tar.gz",
    "platform": null,
    "description": "# pyzkfp\r\n\r\n\r\n[![PyPI version](https://badge.fury.io/py/pyzkfp.svg)](https://badge.fury.io/py/pyzkfp)\r\n\r\n## Overview\r\nBecause ZKTeco offical SDKs suck and are unstable and full of bugs, I decided to make a simple python wrapper library of their SDKs and save you from the agony of using their products.\r\n\r\n## Why?\r\nwhy not?\r\n\r\n## Compatibility\r\nThis library can connect to `SLK20R` and ZK series, including `ZK9500`, `ZK6500`, `ZK8500R` devices.\r\n \r\n## Installation\r\n- You have to first install the ZKFinger SDK from the offical website [here](https://www.zkteco.com/en/Biometrics_Module_SDK/ZKFinger-SDK-for-Windows) or through this direct [link](https://new-website-file.s3.ap-southeast-1.amazonaws.com/files/20220725/9774a946c3f659ddf2ae90bc8dadc3eb.rar) (might stop working) \r\n- Then install this library via pip:\r\n    ```bash\r\n    pip install pyzkfp\r\n    ```\r\n\r\n## Features\r\n- Initialize and interact with ZKFinger Reader devices.\r\n- Capture fingerprint images.\r\n- Perform fingerprint 1:1 comparisons.\r\n- Perform fingerprint 1:N comparisons.\r\n- Register and identify users.\r\n- Light & Beep control functions.\r\n\r\n## Usage\r\nHere's a simple example of how to use this library:\r\n\r\n#### Initialize the ZKFP2 class and open the device\r\n```python\r\nfrom pyzkfp import ZKFP2\r\n\r\n# Initialize the ZKFP2 class\r\nzkfp2 = ZKFP2()\r\nzkfp2.Init()\r\n\r\n# Get device count and open first device\r\ndevice_count = zkfp2.GetDeviceCount()\r\nlogger.info(f\"{device_count} Devices found, Connecting to the first device.\")\r\nzkfp2.OpenDevice(0)\r\n```\r\n\r\n### Capture a fingerprint\r\n```python\r\nwhile True:\r\n    capture = zkfp2.AcquireFingerprint()\r\n    if capture:\r\n        # Implement your logic here\r\n        break\r\n```\r\n\r\n### Perform a 1:N comparison\r\n```python\r\ntmp, img = capture\r\nfinger_id, score = zkfp2.DBIdentify(tmp)\r\n```\r\n\r\n### Perform a 1:1 comparison\r\n```python\r\nres = zkfp2.DBMatch(template1, template2) # returns 1 if match, 0 if not\r\n```\r\n\r\n### Register a fingerprint\r\nIn order to register a fingerprint, we must collect 3 templates from the same finger. And then we can merge them into one template and store it in the device's database.\r\n```python\r\ntemplates = []\r\nfor i in range(3):\r\n    while True:\r\n        capture = zkfp2.AcquireFingerprint()\r\n        if capture:\r\n            print('fingerprint captured')\r\n            tmp, img = capture\r\n            templates.append(tmp)\r\n            break\r\nregTemp, regTempLen = zkfp2.DBMerge(*templates)\r\n\r\n# Store the template in the device's database\r\nfinger_id = 1 # The id of the finger to be registered\r\nzkfp2.DBAdd(finger_id, regTemp)\r\n```\r\n\r\n### Storing and Loading Templates from an External Database for Future Use\r\n\r\nGiven that the device's memory clears upon shutdown, this step is crucial for preserving data. You have the option to store `regTemp` (the final result of the the three merged templates) in your preferred database to retrieve them for later use. The segment of code responsible for loading the registered templates from the database to the device's memory should be run after the device's initialization. Here is a simple way to do it.\r\n\r\n```python\r\n\r\nmembers = ... # load members' `regTemp` and their corresponding fingerPrintId from your database.\r\n\r\nfor member in members:\r\n    fid, temp = member\r\n    zkfp2.DBAdd(fid, temp)\r\n    ...  \r\n```\r\n\r\n\r\n### To turn on/off the light\r\n```python\r\nzkfp2.Light('green') # green/red/white\r\n```\r\n\r\n### Terminate the device and release resources\r\n```python\r\nzkfp2.Terminate()\r\n```\r\n\r\nFor more detailed usage instructions, please refer to the example folder (WIP).\r\n\r\n## Support My Work\r\nIf you found this project useful, please hire a private investigator to legally blackmail ZKTeco's dev team, as this would really help spread the good word of this repository.\r\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "A Python wrapper library for ZKFinger fingerprint scanner software.",
    "version": "0.1.5",
    "project_urls": {
        "Homepage": "https://github.com/alqasemy2020/pyzkfp"
    },
    "split_keywords": [
        "python",
        "fingerprint",
        "scanner",
        "wrapper",
        "library",
        "zkteco",
        "zkfinger",
        "zkfp",
        "zklib",
        "zkaccess",
        "zktime"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "888789567b61734f7ae2880b915b765137d7dad70b8b46c93289cb2a9d582504",
                "md5": "6ccb09cea990e5bbd225c46a0b30034b",
                "sha256": "e29050ddb995a70f0370e9f11b800f526bd3f53f8aaf43ef73e0ac3ed220ab51"
            },
            "downloads": -1,
            "filename": "pyzkfp-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6ccb09cea990e5bbd225c46a0b30034b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 34702,
            "upload_time": "2023-11-30T20:23:49",
            "upload_time_iso_8601": "2023-11-30T20:23:49.612037Z",
            "url": "https://files.pythonhosted.org/packages/88/87/89567b61734f7ae2880b915b765137d7dad70b8b46c93289cb2a9d582504/pyzkfp-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4befbda42448359dc36d37d07da2daea690a7ac607f64f46144659f992def25a",
                "md5": "1d69ca60a6d522a1abf5ceee342aef87",
                "sha256": "90f590072bfdea1f2112b5c95ff239e1b66bd7fa32de09d99f736b366e479b5b"
            },
            "downloads": -1,
            "filename": "pyzkfp-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "1d69ca60a6d522a1abf5ceee342aef87",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 26432,
            "upload_time": "2023-11-30T20:23:50",
            "upload_time_iso_8601": "2023-11-30T20:23:50.755734Z",
            "url": "https://files.pythonhosted.org/packages/4b/ef/bda42448359dc36d37d07da2daea690a7ac607f64f46144659f992def25a/pyzkfp-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-30 20:23:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alqasemy2020",
    "github_project": "pyzkfp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyzkfp"
}
        
Elapsed time: 0.15062s