Python library for ZFM-20 fingerprint sensor
Switch branches/tags
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fixed #48 Nov 11, 2018
COPYING Added project files Mar 6, 2016
LICENSE Added project files Mar 6, 2016 Mentioning more supported sensors Sep 12, 2018

Python library for ZFM fingerprint sensors

The PyFingerprint library allows to use ZhianTec ZFM-20, ZFM-60, ZFM-70 and ZFM-100 fingerprint sensors on the Raspberry Pi or other Linux machines. Some other models like R302, R303, R305, R306, R307 and R551 also work.

Note: The library is inspired by the C++ library from Adafruit Industries:

Package building on Debian

First install the packages for building:

~$ sudo apt-get install git devscripts

Than clone this repository:

~$ git clone

Build the package:

~$ cd ./pyfingerprint/src/
~$ dpkg-buildpackage -uc -us


The library supports Python 2 and Python 3. There are one Debian package for each. It's up to you which version you install.

For Python 3 use:

~$ sudo dpkg -i ../python3-fingerprint*.deb

For Python 2 use:

~$ sudo dpkg -i ../python-fingerprint*.deb

Install missing dependencies:

~$ sudo apt-get -f install

Allow non-root user "pi" (replace it correctly) to use the serial port devices:

~$ sudo usermod -a -G dialout pi
~$ sudo reboot

How to use the library

Enroll a new finger

~$ python /usr/share/doc/python-fingerprint/examples/

Search an enrolled finger

~$ python /usr/share/doc/python-fingerprint/examples/

Delete an enrolled finger

~$ python /usr/share/doc/python-fingerprint/examples/

Download image of a scanned finger

~$ python /usr/share/doc/python-fingerprint/examples/

Generate a 32-bit random number on the ZFM hardware PRNG

~$ python /usr/share/doc/python-fingerprint/examples/

Further information

See my blog post for more information: