en
  • English
  • German
  • Chinese
Drivers & examples
Python API
Parameter Search Sales Contact Support

The Spectrum Instrumentation API has extensive support for Python. There is an implementation  for both low- and high-level Python programming. The low-level API is closely related to C and optimized for speed. The high-level general-purpose object-oriented API is located on Github and available through the pip repository and optimized for usability and learning how to use the cards. 

Low-level Python API 

The low-level Python API is directly communicating with the Spectrum Instrumentation general driver library, both on Windows (.dll) and Linux (.so). The translation from Python code to dynamic library call is done using ctypes. This low-level API supports both Python 2 and Python 3 and has no external dependencies. The package is can be downloaded in the Downloads section of the Spectrum Instrumentation website: 

High-level object oriented Python package spcm 

Screenshot of Python ExampleBuild on top of the low-level Python API, there is a general purpose high-level object oriented Python package. This spcm package is available through the PIP repository and is easily installed using the straight-forward pip install spcm command.

The package automatically handles correct opening and closing of cards and Netbox devices, including sets of synchronizes cards. It also implements error handling through exceptions.

Moreover, the package handles allocation of memory and provides a direct interface to numpy and support for physical quantities and units through pint. A multitude of card functionalities are implemented in easy-to-use classes and examples. The spcm package can be found here: 

The spcm is free-to-use and freely available to all Spectrum Instrumentation card users under the MIT-license. The package is only available for Python 3 starting with version 3.9. 

 

Contact

On location for you. Choose your region.

Europe USA Asia
Contact Europe
Phone +49 (0)4102 6956-0
Fax +49 (0)4102 6956-66
E-Mail info@spec.de
Contact USA
Phone +1 (201) 562-1999
Fax +1 (201) 820-2691
E-Mail sales@spectrum-instrumentation.com
Contact Asia
Phone +61 402 130 414
E-Mail greg.tate@spectrum-instrumentation.com
Support

Request support. We are happy to help.

Support
powered by webEdition CMS