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.0.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.0.0
File Size Uploaded Provenance Actions
async_gpib-3.0.0.tar.gz 112.6 kB Without provenance Details for async_gpib-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 132.8 kB

Release files / async_gpib-3.0.0.tar.gz

Download URL async_gpib-3.0.0.tar.gz
Size 112.6 kB
Tags Source
SHA-256 checksum
How to use checksums
57ed223916b1d2188bd1720dc2d24491746a0333f28d081d424851044d1097e6
BLAKE2b-256 checksum
How to use checksums
efafaf34f282acce36707f3d3cf5c58c51b3a1fbe1e34075540f9e6409a39964
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.0.0-py3-none-any.whl

Download URL async_gpib-3.0.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bbe98860c5c271404ab4f8a3f65ceea3e87e18c01e354fd79ae016fbe0d0792
BLAKE2b-256 checksum
How to use checksums
61593e4f59a000b11996126099a8144bf79039d335fd5c868e4c490c9aad4d72
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.0.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