InsPy
Introduction
InsPy is a Python library and command-line tool for controlling test and measurement instruments (oscilloscopes, power supplies, digital multimeters etc) over USB, Serial, or LAN connections.
It provides a consistent, vendor-agnostic API across supported instrument brands, so the same code works with a variety of instrument manufacturers. InsPy makes it easier to write repeatable, automated test scripts without hand-coding raw SCPI commands for each device. Its OOP-based framework allows new instruments to be easily added, producing a scalable tool tailored to your test automation needs.
Links
Table of Contents
Installation
Command line
pip install cc-inspy
To check your install in command line run:
inspy --version
And as always you can get help:
inspy --help
To interface an instrument using USB on Windows, install Keysight IO Libraries Suite.
If you are running InsPy on Linux and want to connect your device via USB, then you also have to do the following:
sudo tee /etc/udev/rules.d/99-inspy.rules > /dev/null <<'EOF'
SUBSYSTEM=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx", MODE="0660", GROUP="plugdev"
EOF
sudo usermod -aG plugdev "$USER"
sudo udevadm control --reload-rules && sudo udevadm trigger
This is to make it so that inspy (and pyVISA) can see your USB device.
Wheel
- Download the wheel from the InsPy Releases page.
pip install cc-inspy-*-py3-none-any.whl
pyproject.toml
Add 'inspy' to the list of dependencies, for example:
[project]
dependencies = [
"cc-inspy"
]
requirements.txt
Add the following to your requirements.txt:
cc-inspy==1.0.0
(replace the version number with the desired version - versions can be identified via the tags)
Uv package manager
- Add InsPy as a project dependency
uv add cc-inspy. - Run
uv syncto install all dependencies.
Development
See below for information on how to setup a local development environment, contribute to the project, run tests, and build documentation.
Setup
To get setup using InsPy:
- Clone this repository:
git clone https://github.com/cambridgeconsultants/inspy.git - Navigate back to the inspy repo and install:
cd inspy
uv sync
-
Reload your IDE (VSCode:
Ctrl+Shift+Pand enterDeveloper: Reload Window) (this may be required when you make changes to your editable) -
Check editable installed by entering the following terminal command - the inspy version should be returned:
uv run inspy --version
And you should see it auto complete will the modules in the package. If not, check the correct venv is selected (Ctrl+Shift+P Python: Select Interpreter)
Contributing
To add instruments and develop on this project, please follow the instructions in CONTRIBUTING.md in the repository root.
Testing and test development
We use pytest for writing and running tests. Tests should live in a separate file for each instrument, and separately from the development code.
Test files and test functions must start with the prefix test_, for
example test_oscilloscope_<model_no>.py, containing test_get_voltage.
Example:
# test_oscilloscope_<model_no>.py
def test_get_voltage():
"""Dummy test."""
assert True
You can run these tests using the commands:
uv run pytestto run all test files in the project (bear in mind many tests need real instruments to be connected so they may fail) - not recommended.uv run pytest test_file_name.pyto run all tests in a specific file. This can be run on multiple files in one line too.uv run pytest test_file_name.py::test_funcfor a specific test in that file.
Releases
When there's a commit to main signifying a release, a versioned tag will be added e.g., v2.0. The built package is then stored in the GitHub releases using the versioned release tag.
Building the docs
sphinx-build -b html ./docs ./docs/_build/html -W
You can then open _build/html/index.html in your browser. In windows you can run:
start docs/_build/html/index.html
Getting Started
Now you have installed InsPy, check out the quick start guide
License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Metadata
Release files for cc-inspy 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cc_inspy-1.1.1.tar.gz | 583.6 kB | With provenance | Details for cc_inspy-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cc_inspy-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for cc_inspy-1.1.1-py3-none-any.whl |
Total release size: 658.8 kB
Release files / cc_inspy-1.1.1.tar.gz
| Download URL | cc_inspy-1.1.1.tar.gz |
|---|---|
| Size | 583.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28097950d8762cf1261e51e3e0b838d93a5e5ca213d303ec35f46e1032673e41
|
|
BLAKE2b-256 checksum How to use checksums |
7f7c42b1198f55676b619d51cea56609e9f8bf3b4f79793d0959571d686911b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / cc_inspy-1.1.1-py3-none-any.whl
| Download URL | cc_inspy-1.1.1-py3-none-any.whl |
|---|---|
| Size | 75.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e88521638613cef5680af27775df5ce0ac7b75fc2b0b22db76c7a40846487550
|
|
BLAKE2b-256 checksum How to use checksums |
917b194ca16ece7ae33b3f313a03058984abbba731e02a2dc43a70d721e1c86e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logSecurity for cc-inspy 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cc_inspy-1.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.