Registry / serialization / pyadi-iio

pyadi-iio

JSON →
library0.0.21pypypiunverified

pyadi-iio is a Python abstraction module developed by Analog Devices for interfacing with their hardware devices that utilize Industrial I/O (IIO) drivers. It simplifies interaction with complex IIO interfaces by providing device-specific APIs, reducing boilerplate code for common operations like data acquisition and control. The current version is 0.0.20, and the library is actively maintained with ongoing development and contributions.

pip install pyadi-iio
INSTALL
IMPORT
SIG · PYADI-IIO
P
pyadi-iio
serializationpythonv0.0.21
Install
4.5s avg
Import
Disk
91MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.21 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 91.7MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 4.5s · import 0.000s · 88MB
91MB installed
● package 91MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

adi
import adi
import adi

Initializes a connection to an Analog Devices IIO device, typically an SDR like AD9361, using its URI (IP address for network connection). It then demonstrates reading a device property and capturing a block of RX data. The `ADIIO_URI` environment variable can be used to specify the device's address, otherwise a default IP is attempted. This requires the `libiio` C library to be installed and the hardware device to be reachable.

import adi import os # Replace with your device's actual IP address or leave empty for local/USB detection # Ensure the target hardware is powered on and configured for network/USB communication # For network connection, the IP address should be accessible from the host. # Example: 'ip:192.168.2.1' for Ethernet, 'usb:1.24.5' for specific USB device device_uri = os.environ.get('ADIIO_URI', 'ip:192.168.2.1') try: # Create a device interface for a supported device, e.g., AD9361 sdr = adi.ad9361(uri=device_uri) # Example: Print RX LO Frequency print(f"RX LO Frequency: {sdr.rx_lo}") # Example: Capture and print some RX data (ensure device is transmitting/receiving) # This part assumes the device is configured and streaming data. # In a real scenario, you'd configure sample rates, gains, etc. before reading. sdr.rx_buffer_size = 2**12 # Set buffer size data = sdr.rx() print(f"Captured {len(data)} RX samples.") # print(f"First 10 RX samples: {data[:10]}") # Uncomment to see sample values except Exception as e: print(f"Could not connect to or interact with device at {device_uri}: {e}") print("Please ensure libiio is installed and the device is accessible. " "Refer to pyadi-iio documentation for device-specific setup.")
Debug
Known issues
gotchaThe `libiio` C library is a fundamental prerequisite and must be installed separately on your operating system; it is not installed by `pip install pyadi-iio`. While `pylibiio` (Python bindings) is automatically installed, the underlying C library is crucial for functionality.
fix
Refer to the Analog Devices libiio GitHub repository for platform-specific installation instructions (e.g., apt-get on Linux, Windows installer). For Linux, building from source often requires the `-DPYTHON_BINDINGS=ON` CMake flag.
affects: All versions
gotchaOn Linux, if `libiio`'s Python bindings (pylibiio) are installed from source or in non-standard locations, the Python interpreter might not find them, leading to import errors even if `pyadi-iio` is installed. This often happens within virtual environments.
fix
Set the `PYTHONPATH` environment variable to include the directory where `pylibiio` is installed (e.g., `export PYTHONPATH=$PYTHONPATH:/usr/lib/python{PYTHON VERSION}/site-packages`). Alternatively, install virtual environments with `--system-site-packages`.
affects: All versions
breakingAccessing certain read-only properties (e.g., `rx_sample_rate`, `dac_frequency`) for multi-channel/multi-chip devices like QuadMxFE in `pyadi-iio` v0.0.19 and possibly other versions can result in a `KeyError`. This indicates internal attribute naming changes or inconsistencies.
fix
Check the device's specific API documentation or the `pyadi-iio` GitHub issues for the correct attribute names or methods to access these properties. Upgrading to a newer version may also resolve the issue if a fix has been implemented.
affects: 0.0.19 (QuadMxFE)
gotchaWhen working with devices that have multiple channels (e.g., for RX or TX), controlling individual channel states (enable/disable) or setting specific gains for each channel might not be intuitive or directly supported by simple list assignments, leading to errors.
fix
Consult the device-specific documentation or source code for the correct methods to enable/disable channels (e.g., by specifying `rx_enabled_channels = [0]` for channel 0) and to set individual gains. Direct attribute manipulation using `_ctrl.debug_attrs` might be necessary for advanced configurations.
affects: All versions
Upgrade
Version history
0.0.21latest on PyPI · released May 26, 2026
Audit
Dependencies
libiiorequiredCore C library for IIO devices, must be installed separately (not via pip). Python bindings (pylibiio) are typically handled by pyadi-iio's pip install.
pylibiiorequiredPython bindings for libiio. Automatically installed by pyadi-iio via pip since libiio v0.21.
numpyrequiredRequired for numerical operations and data handling.
paramikooptionalOptional dependency for JESD204 debugging and control.
Agent activity
24 hits · last 30 days
node
24
Resources
pyadi-iio — pip install pyadi-iio · libregistry