Package: picosdk
Note:This version of the library is built off of my (@ksunden) personal github fork of the picosdk repo.
I am distributing via PyPI as permitted under the terms of the ISC license.
I do not intend to make any changes to the actual library, only to the packaging (e.g. using setuptools, changing the version number for releases).
If a representative of PicoTech contacts me, I will gladly transfer ownership of the PyPI namespace to the company.picosdk-python-wrappersWelcome to the PicoSDK for Python. It allows you to control PicoScope devices in your own Python programs.Getting startedTo use this code you will need to install the PicoSDK C libraries.Microsoft WindowsPlease visitour Downloads pageto download the 32-bit or 64-bit PicoSDK C Libraries for Windows.
Please take care to match the "bitness" of your python to the PicoSDK.LinuxFollow the instructions from ourLinux Software & Drivers for Oscilloscopes and Data Loggers pageto install the required driver packages for your product.macOSmacOS users should install PicoScope Beta for macOS, and then may find thisforum posthelpful for installing the C
libraries.Installing the python driver bindingsAdistutilsinstaller is provided. After you have installed the PicoSDK
driver package (see above), the Python installer can be used as follows:python setup.py installOn macOS and Linux you will either need to usesudowith this command, to
install into the system folders, or to install for the current user only you
can use:python setup.py install --userWithin python, the library forimportis calledpicosdk.CompatibilityThis code is written to be compatible with both python 2.7 and python 3 (any version).If you find a compatibility problem please raise anIssue, listing all the versions you can find (python, numpy,
picosdk commit hash, etc.) and your error message(s).C interfaceYou can access C driver functions directly (ctypes calls) by their original C name, following theProgrammer's
Guidesexactly. Examples are provided in the folders likepsX000[a]Examples/.Programmer's GuidesYou can download Programmer's Guides providing a description of the API functions for the relevant PicoScope or
PicoLog driver from ourDocumentation page.Python interfaceWe are in the process of adding Pythonic wrappers around the C functions. If we haven't got to your feature yet or your device is listed as one of theunsupported models,
let us know that you're waiting in anIssueUnsupported modelsThe following drivers and devices are not yet supported:plcm3- PicoLog CM3 Current Data Loggerps3000- PicoScope 3204, 3205, 3206, 3223, 3224, 3423 & 3423usbpt104- PT-104 Platinum Resistance Data LoggerDependenciesAs well as depending on the C libraries, the Pythonic wrappers use some python libraries likenumpy. Many of the
examples scripts also use thematplotlibplotting library. You can install these dependencies with pip as follows:pip install -r requirements.txt
pip install -r requirements-for-examples.txtDriver-agnostic examplesTheanyScopeExamplesfolder contains examples in pure python which do the same thing as the C-style examples, but
in a driver-generic way.Python ClassesLibrarypicosdk.library.Librarycontains a base class for each of the driver classes. It does the job of translating python
types into C ones, and back again, and some unit conversions to get rid of nano, micro and milli-style prefixes. It also
handles any differences in programming API between PicoScope driver versions.Devicepicosdk.device.Devicecontains the concrete class which represents a PicoScope with a valid handle. It caches some
information about the device state, like the currently selected voltage ranges of the channels.It is implemented in terms of the Library class' public interface, and deals almost entirely with python types. The
main exception is its handling of numpy arrays - it (knowing the voltage ranges) is responsible for converting the raw
ADC counts that the driver uses for amplitude into physical units.Testing this codeCheck which device driver your device uses, and check the constants at the top of test/test_helpers.py to enable the
relevant drivers for connected-device tests. (most tests use this).To check which driver your device uses, you can usepicosdk.discover:from picosdk.discover import find_all_units

scopes = find_all_units()

for scope in scopes:
    print(scope.info)
    scope.close()You should then configure test/test_helpers.py's list of connected devices, so it can run all the tests we have
on your device.To run the unit tests, you will need to install nose (e.g.pip install nose.) Then, runnosetestsin the root of
the repo.Obtaining supportPlease visit ourSupport pageto contact us directly or visit ourTest and Measurement Forumto post questions.Copyright and licensingSeeLICENSE.mdfor license terms.PicoScope,PicoLogandPicoSDKare registered trademarks of Pico Technology Ltd.Windowsis a registered trademark of Microsoft Corporation.macOSis a registered trademark of Apple Inc.Linuxis the registered trademark of Linus Torvalds in the U.S. and other countries.Copyright © 2018-2019 Pico Technology Ltd. All rights reserved.