[Pcsclite-muscle] An alternate Python library for PC/SC Lite

russell+muscle at stuart.id.au russell+muscle
Mon Dec 8 15:41:36 PST 2014


Python-pcsclite is a set of Python2 bindings for the PC/SC lite library.  It is hosted on Sourceforge:

  http://python-pcsclite.sourceforge.net/

Complete documentation is available at:

  http://python-pcsclite.sourceforge.net/doc/html/

A review of python-pcsclite was posted by Ludovic Rousseau in his blog, where he compared it to Pyscard:

  http://ludovicrousseau.blogspot.fr/2014/12/pcsc-sample-in-python-using-python.html

The blog post correctly observes that Python-pcsclite does the same job as pyscard, so the choice is a matter of taste.  The main difference is python-pcsclite providers a fairly direct implementation of the PC/SC lite C library, whereas pyscard provides it's own abstractions.  Users of the PC/SC C library should find python-pcsclite fairly familiar territory - it's just the C bindings with the some of the methods for shooting yourself in the foot removed.

Since pyscard's abstractions operate at a higher level and so can be simpler to use.  However python-pcsclite comes with a iso7816 library that operates at a higher level again - it decodes the responses from smart card commands.  The accompanying usimtool program provides a command line interface to the iso7816 library.  It can do things like dump the directory tree, read and write files, and unlock the SIM using PIN1 and PIN2.  Simple smart card jobs can be done by calling usimtool from a shell script.  Usimtool and iso7816.py are shipped as examples for python-pcsclite.

Finally, a note to the whoever who maintains http://pcsclite.alioth.debian.org/musclecard.com : The one python library listed there has broken links.  It would be nice if the entry was replaced by pointers to pyscard and python-pcsclite.




More information about the pcsclite-muscle mailing list