Skip to content
An object-oriented interface for the Comedi drivers
Python Shell
Branch: master
Clone or download
Pull request Compare This branch is even with wking:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This package provides an object-oriented interface to the Comedi_
drivers.  The standard Python interface bundled with Comedilib is a
simple SWIG clone of the C interface.  In pycomedi, we convert the
functions into class methods (see ``pycomedi.classes``), so you don't
have to worry about dragging around opaque types like ``comedi_t *``
device pointers.  We also bundle related constants together in
``_Enums`` and ``_Flags`` (see ``pycomedi.constants``), to make
handling common operations like flag manipulations simpler.  Finally,
there are a number of utility classes (see ``pycomedi.utility``) to
make common tasks like creating instructions or reading hardware-timed
analog input easier.




I've packaged pycomedi for Gentoo.  You need layman_ and my `wtk
overlay`_.  Install with::

    # emerge -av app-portage/layman
    # layman --add wtk
    # emerge -av dev-python/pycomedi


If you're installing by hand or packaging pycomedi for another
distribution, you'll need the following dependencies:

============  ===================  ================  ==============================
Package       Purpose              Debian_           Gentoo_
============  ===================  ================  ==============================
NumPy_        ?                    python-numpy      dev-python/numpy
SciPy_        testing              python-scipy      sci-libs/scipy
Comedi_       Comedilib interface  python-comedilib  sci-libs/comedilib [#wtk]_
nose_         testing              python-nose       dev-python/nose
Cython_       Comedilib interface  cython            dev-python/cython
python-kmod_  Optional ext. info.                    dev-python/python-kmod [#wtk]_
============  ===================  ================  ==============================

.. [#wtk] In the `wtk overlay`_.

If python-kmod is installed, you will get additional module
information from the ```` demo program.  If it is not
installed, everything will still work, but ```` will only be
able to get the module version, not the kernel version, staging-ness,
parameters, etc.

Installing by hand

Pycomedi is available as a Git_ repository::

    $ git clone git://

See the homepage_ for details.  To install the checkout, run the

    $ python install


See the examples in the ``doc`` directory.


Run integration tests with::

    $ nosetests --with-doctest --doctest-extension=txt doc

The analog integration tests read from analog input channels 0 through
3, and write to analog output channels 0 and 1, so you'll need a board
with that many channels.  You should also make sure that the analog
output channels aren't plugged into anything sensetive, since the
tests sweep their output around over a reasonable chunk of the channel
range.  Some of the internal unit tests also write, so it's safest to
just disconnect all digital lines and analog outputs before running
the tests.

Run both integration tests and internal unit tests with::

    $ ./


This project is distributed under the `GNU General Public License
Version 2`_ or greater.


W. Trevor King

.. _Comedi:
.. _layman:
.. _wtk overlay:
.. _science overlay:
.. _Debian:
.. _Gentoo:
.. _NumPy:
.. _SciPy:
.. _nose:
.. _Cython:
.. _python-kmod:
.. _Git:
.. _homepage:
.. _GNU General Public License Version 2:
You can’t perform that action at this time.