Skip to content

pysdrlib

Python wrappers for hardware SDRs: every radio has the same API, and samples are always complex64.

pip install pysdrlib
pip install pysdrlib[remote]     # also use radios on another machine (ZeroMQ)

This is a lightweight backend for my pyspecan and RPPS projects, with minimal user intervention. It has no affiliation to the fantastic pysdr page. For a more robust C implementation with far more hardware, use SoapySDR.

Supported devices

Device Driver Notes
RTL-SDR rtl_sdr
HackRF hackrf Transmit (half-duplex)
USRP B210 (UHD) uhd 2 RX and 2 TX channels
USRP X310, X410 (UHD) x310, x410 Experimental, untested on hardware; on a network (find(addresses=...)), needs a system libuhd
RX-888 (ExtIO) extio
BladeRF 2.0 micro bladerf 2 RX and 2 TX channels; tested on a 2.0 micro xA4 (receive), transmit checked for plumbing only
TCP IQ stream tcpiq Receive raw I/Q over TCP, as the client (host=, port=) or the server (listen=True); not listed by find()

Also: sim, a simulated radio that needs no hardware, file, which plays a recording back as a radio, and shm, which receives a stream another process publishes in shared memory (ShmStream). A radio needs its vendor's library: pysdrlib build builds the bundled copy (Installing).

Quickstart

import pysdrlib

for info in pysdrlib.find(virtual=True):    # radios attached (virtual=True: the simulated one too)
    print(info.driver, info.label, info.serial)

sdr = pysdrlib.open("sim")                 # a driver name; or a DeviceInfo from find(), or "<driver>@<serial>"
sdr.initialize(cf=100e6, Fs=2e6)           # center frequency and sample rate
sdr.set_rx_gain(0.5)                       # half of this radio's gain range, whatever the radio
sdr.start_rx()
x = sdr.read(65536, timeout=1.0)           # exactly 65536 complex64 samples (err.Timeout after 1 s)
sdr.stop_rx()
sdr.close()

Guides

License

Copyright (C) 2025-2026 Anonoei and contributors. pysdrlib is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See LICENSE. Releases up to 0.4.6 were MIT-licensed.