Python bindings for the LimeDriver
Go to file
Kumi 0568a820af
Simplify build and link HDF5 libraries
Removed custom BuildExtCommand class from setup.py, simplifying the
build process by relying on standard build_ext behavior. The custom
command handling of submodule initialization and build extension
modifications were deemed unnecessary. Additionally, extended the
library dependencies to include 'hdf5_cpp' and 'hdf5' to ensure correct
linking for HDF5 support. This change makes the build process more
straightforward and maintainable.
2024-02-10 18:02:07 +01:00
.github/workflows Removed redundant Ubuntu-specific build workflow; 2024-02-10 16:36:18 +01:00
extern Updated limedriver submodule to latest commit 2024-02-10 16:28:28 +01:00
src/limedriver Removed another debug print. 2024-02-10 17:55:02 +01:00
.gitignore Enhance package build process 2024-02-08 15:19:25 +01:00
.gitmodules Added limedriver as submodule. 2024-02-07 16:40:02 +01:00
LICENSE Update LICENSE 2024-02-10 14:56:32 +01:00
MANIFEST.in Enhance package build process 2024-02-08 15:19:25 +01:00
pyproject.toml Updated limedriver subproject and Python 2024-02-09 12:41:57 +01:00
README.md Updated README with submodule init instructions 2024-02-10 15:00:57 +01:00
setup.py Simplify build and link HDF5 libraries 2024-02-10 18:02:07 +01:00

Python Bindings for LimeDriver

This is a Python package for the LimeDriver library.

Dependencies

To build the Python bindings, you will need to have the dependencies for LimeDriver installed, as well as the Python development headers.

Debian/Ubuntu

sudo apt-get install g++ cmake libhdf5-dev liblimesuite-dev python3-dev python3-pip python3-venv

Arch Linux

sudo pacman -S gcc cmake hdf5 limesuite python python-pip

Installation

It is recommended to install the Python bindings in a virtual environment. To create a new virtual environment, run the following commands:

python3 -m venv venv
source venv/bin/activate

Ensure that the LimeDriver submodule is initialized:

git submodule update --init

Now, the Python bindings can be built and installed using pip:

pip install .

Usage

The Python bindings provide a high-level interface to the LimeDriver library:

# Import the LimeDriver module
import limedriver

# Set the number of pulses to generate
Npulses = 1000

# Create a new PyLimeConfig object
config = limedriver.PyLimeConfig(Npulses)

# Modify the config as needed
config.srate = 1e6

# Execute the config on the LimeSDR
config.run()

# Get the path to the output file
filename = config.get_path()

# Use the built-in HDF5 reader to read the output file
data = limedriver.hdf_reader.HDF(filename)
data.print_params()