Welcome to pyhard2’s documentation!

pyhard2 is the free device-driver development toolkit (DDK) written in Python.

It provides an alternative to other DDKs like LabVIEW, the Windows Driver Kit, and Matlab on the desktop and in the lab. It is the free software choice for free hardware projects on Arduino/Raspberry Pi/BeagleBone hardware.

  • Written entirely in Python, pyhard2 is completely free and open source.
  • Runs on any platform Python supports (including, but not limited to, MS Windows, Mac OS X, Linux and the BSDs).
  • SCPI drivers are supported.
  • New drivers should take about 0.5 to 1 day to write and do not require a large amount of code.
  • Graphical user interfaces are loosely coupled to the driver.
  • Creating the GUI from Qt Designer (ui-files) is supported.
  • The library takes care of threading when the driver is used in a GUI.
  • Easily create a Dashboard presenting a live overview over every running controller.


The following shows what pyhard2’s Dashboard looks like.

Screenshot of an GUI

And an interactive session using a pyhard2 driver may look like the following:

>>> import pyhard2.driver as drv
>>> import pyhard2.driver.fluke as fluke
>>> ser = drv.Serial("COM1")
>>> multimeter = fluke.Fluke18x(ser)
>>> multimeter.measure.read()
>>> multimeter.unit.read()
"Deg C"
>>> multimeter.press_button_blue.write()
>>> multimeter.measure.read()
>>> multimeter.unit.read()
"Deg F"



pyhard2 - An object-oriented framework for the development of instrument drivers. Copyright (C) 2012-2014, Mathias Laurin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


The project is hosted on github and sourceforge. Follow the sourceforge link for the HTML documentation.

To install, either download the archive from the project page on sourceforge and unpack it in an empty directory or clone the git repository from github

Then, in the project root, run:

python setup.py install

pyhard2 depends on

  • pyserial: Multiplatform Serial Port Module for Python (Win32, Jython, Linux, BSD and more).
  • PyQt4: version 4.8 or higher.
  • PyQwt5: current version is 5.2.

and optionally on

Development and contributing

Please file issues on github. Questions may be asked on the mailing list.

Any feedback provided via these channels is very welcome.

Indices and tables