Skip to main content

pylint Coverage PyPI PyPI - Python Version PyPI - Status License: GPL v3 code style

async_gpib

Python3 asyncio Linux GPIB Wrapper. The library requires Python 3.12 or newer and uses asyncio. It is a thin wrapper for the threaded Linux GPIB Wrapper library.

The library is fully type-hinted.

Supported Devices

Instruments

Device Supported Tested Comments
Fluke 5440B ✔️ ✔️
HP 3478A ✔️ ✔️

Setup

There are currently no packages for Linux GPIB available on all platforms. To install the library it is required to install Linux GPIB.

Linux GPIB:

These instructions are for Ubuntu:

sudo apt install subversion build-essential autoconf libtool flex bison python3-dev
svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk linux-gpib-code
cd ~/linux-gpib-code/linux-gpib-kernel
make
sudo make install  # ignore the signing errors
sudo groupadd gpib  # seems not to be installed
sudo modprobe ni_usb_gpib
cd ~/linux-gpib-code/linux-gpib-user
./bootstrap
./configure --sysconfdir=/etc
make
sudo make install
sudo ldconfig

Linux GPIB Python module:

Once Linux GPIB is installed, you can either install the python package or use the gpib-ctypes package.

python3 -m venv env  # virtual environment, optional
source env/bin/activate
pip install -e ~/linux-gpib-code/linux-gpib-user/language/python/

async_gpib Python module

The package can be directly installed via Pypi:

python3 -m venv env  # virtual environment, optional
source env/bin/activate
pip install async-gpib

Usage

Initialize the GPIB adapter

from async_gpib import AsyncGpib

# Create a controller and talk to device address 22
async with AsyncGpib(name=0, pad=22) as gpib_device:
    # Add your code here
    ...

Errors reported by the GPIB library are raised as async_gpib.GpibError, timeouts as TimeoutError and calls on a closed connection as ConnectionError.

See examples/ for more working examples.

Support for Multiple Devices

⚠️ Concurrency with multiple devices: Note, that when using a single adapter to control multiple devices, there is no concurrency on the GPIB bus. This means, there is no speed increase, when making asynchronous reads from multiple devices on the bus regarding the transfer time.

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

Documentation

I use the Numpydoc style for documentation.

Authors

License

This project is licensed under the GPL v3 license - see the LICENSE file for details

Metadata

Release files for async-gpib 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for async-gpib 3.2.0
File Size Uploaded Provenance Actions
async_gpib-3.2.0.tar.gz 113.6 kB Without provenance Details for async_gpib-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for async-gpib 3.2.0
File Interpreter ABI Platform Actions
async_gpib-3.2.0-py3-none-any.whl Python 3 none any Details for async_gpib-3.2.0-py3-none-any.whl

Total release size: 134.3 kB

Release files / async_gpib-3.2.0.tar.gz

Download URL async_gpib-3.2.0.tar.gz
Size 113.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f2592fdc90ccff67c7492c353ff2e1c0053262e91ca533ba2c9b1ca2cf986147
BLAKE2b-256 checksum
How to use checksums
85e18f730b339344fb3e69471d7efd3799d766ff2fcd1bb85bca1fed951682ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / async_gpib-3.2.0-py3-none-any.whl

Download URL async_gpib-3.2.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70d761741086562bf580e44862dcc110729c4862e5795e70c7f64d61c8a06534
BLAKE2b-256 checksum
How to use checksums
6de23f37895742dbf00aa1057b5a48250c99d3b2202c940adfc52835a92fb24e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for async-gpib 3.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page