{"id":21850876,"url":"https://github.com/nikialeksey/fpscanner","last_synced_at":"2025-10-04T22:46:43.833Z","repository":{"id":57432076,"uuid":"145891191","full_name":"nikialeksey/fpscanner","owner":"nikialeksey","description":"Python driver for fingerprint scanner","archived":false,"fork":false,"pushed_at":"2021-04-23T02:43:50.000Z","size":416,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-25T04:37:29.195Z","etag":null,"topics":["driver","dy-50","fingerprint","fingerprint-scanner","fpm10a","python","python2","rs-232","sensor","zfm-20","zhiantec"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikialeksey.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-23T18:16:18.000Z","updated_at":"2024-06-11T03:35:56.000Z","dependencies_parsed_at":"2022-09-19T08:02:10.425Z","dependency_job_id":null,"html_url":"https://github.com/nikialeksey/fpscanner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikialeksey/fpscanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikialeksey%2Ffpscanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikialeksey%2Ffpscanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikialeksey%2Ffpscanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikialeksey%2Ffpscanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikialeksey","download_url":"https://codeload.github.com/nikialeksey/fpscanner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikialeksey%2Ffpscanner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278386121,"owners_count":25978109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["driver","dy-50","fingerprint","fingerprint-scanner","fpm10a","python","python2","rs-232","sensor","zfm-20","zhiantec"],"created_at":"2024-11-28T00:25:04.473Z","updated_at":"2025-10-04T22:46:43.801Z","avatar_url":"https://github.com/nikialeksey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python driver for fingerprint sensors by Zhiantec - ZFM-20 series\n\n[![PyPI version](https://badge.fury.io/py/fpscanner.svg)](https://badge.fury.io/py/fpscanner)\n[![PDD status](http://www.0pdd.com/svg?name=nikialeksey/fpscanner)](http://www.0pdd.com/p?name=nikialeksey/fpscanner)\n\n## Is your scanner can be managed by this library?\nIf your scanner is ZFM-20 or his cheap clone then it possible. I made this library inspired by \n[pyfingerprint](https://github.com/bastianraschke/pyfingerprint), so it may also work with ZFM-60, ZFM-70, ZFM-100,\nR303 and R305.\n\n## Origin manuals\nFingerprint protocol specs are taken from \n[original ZHM-20 user manual](https://raw.githubusercontent.com/nikialeksey/fpscanner/master/ZFM+user+manualV15.pdf).\n\n## Terminology\n\n**Image**\n\n  Image is a Fingerprint scanned grayscale image. Image can be scanned and stored in volatile image buffer.\n   \n**Characteristic**\n\n  Characteristic is a fingerprint characteristic. It represented by a bytearray. Characteristic can be created from \n  fingerprint image and stored in volatile characteristic buffer.\n  \n**Template**\n\n  Template is a registered fingerprint model stored in scanner nonvolatile memory. \n  We can not see or feel the template, we only can ask scanner if characteristic look like some template \n  in scanner memory.\n  \n## Working with sensor\n \n### Handshake\n \nFirst of all you need make a handshake to verify connection:\n ```python\nwith SerialPort(Serial(port='\u003cCOM1 or /dev/ttyUSB0\u003e', baudrate=9600 * 6, timeout=2)) as port:\n    rq = RqCommand(port)\n    rs = RsSimple(port)\n    Handshake(rq, rs).make()\n```\nAs you see you will need to know serial port name of your scanner device. For windows users it may looks like `COM1`,\nfor unix users it may looks like `/dev/ttyUSB0`.\n\n### Fingerprint image\n\nMore complex task - make an image of your fingerprint:\n```python\nwith SerialPort(Serial(port='...', baudrate=9600 * 6, timeout=2)) as port:\n    rq = RqCommand(port)\n    rs = RsSimple(port)\n    print 'Waiting for finger...'\n    while not Scan(rq, rs).is_scanned():\n        pass\n    print 'Finger has been scanned! Downloading the finger image...'\n    image = UpImage(rq, rs).image()\n    image.show()\n```\n\n### Matching characteristics\n\nAnother more complex task - match characteristics of two fingerprints. Fingerprint scanner can matching only two \nfingerprints and it has two buffers for that operation - `RqCharBuffer1` and `RqCharBuffer2`.\n```python\nwith SerialPort(Serial(port='...', baudrate=9600 * 6, timeout=2)) as port:\n    rq = RqCommand(port)\n    rs = RsSimple(port)\n    print 'Wait for finger...'\n    while not Scan(rq, rs).is_scanned():\n        pass\n    Img2Tz(rq, rs, RqCharBuffer1()).execute()\n\n    print 'Once again...'\n    while not Scan(rq, rs).is_scanned():\n        pass\n    Img2Tz(rq, rs, RqCharBuffer2()).execute()\n\n    print 'Score {0}'.format(Match(rq, rs).score())\n```\n\n### Enroll fingerprint\n\nAnother complex task is enroll a finger.\n```python\nwith SerialPort(Serial(port='...', baudrate=9600 * 6, timeout=2)) as port:\n    rq = RqCommand(port)\n    rs = RsSimple(port)\n    print 'Wait for finger...'\n    while not Scan(rq, rs).is_scanned():\n        pass\n\n    Img2Tz(rq, rs, RqCharBuffer1()).execute()\n    searchResult = Search(rq, rs, start=0, count=TemplateCount(rq, rs).as_int()).execute()\n\n    if searchResult.code() == 0:\n        print 'Template already exist'\n        exit(1)\n\n    print 'Once again...'\n    while not Scan(rq, rs).is_scanned():\n        pass\n\n    Img2Tz(rq, rs, RqCharBuffer2()).execute()\n    score = Match(rq, rs).score()\n    RegModel(rq, rs).execute()\n    Store(rq, rs, RqCharBuffer1(), 1).execute()\n    print 'Stored success!'\n```\n\n### Match fingerprint with it db saved version\n\n```python\nwith SerialPort(Serial(port='...', baudrate=9600 * 6, timeout=2)) as port:\n    rq = RqCommand(port)\n    rs = RsSimple(port)\n    while not Scan(rq, rs).is_scanned():\n        pass\n    Img2Tz(rq, rs, RqCharBuffer1()).execute()  # save scanned finger to the buffer 1\n    \n    templatesCount = TemplateCount(rq, rs).as_int()  # get all templates count\n    searchResult = Search(rq, rs, start=0, count=templatesCount).execute()  # find finger in the db\n    \n    if searchResult.code() != 0:\n        print('Finger has not been saved!')\n    else:\n        number = searchResult.number()  # finger index in the db\n        print('Finger found in index {0}'.format(number))\n        LoadChar(rq, rs, RqCharBuffer2(), number).execute()  # extract original template to the buffer 2\n    \n        print('Score {0}'.format(Match(rq, rs).score()))  # Match it!\n```\n\n@todo #1:30m Add deletion enrolled fingers","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikialeksey%2Ffpscanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikialeksey%2Ffpscanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikialeksey%2Ffpscanner/lists"}