lofarSun is a Python toolset for solar radio imaging spectroscopy data processing from the Low Frequency Array (LOFAR) telescope. The package provides comprehensive tools for processing LOFAR solar observations, including beamformed data (dynamic spectra), interferometric imaging, and data analysis. It includes three main modules: (1)
lofarSun.BF for dynamic spectrum processing with RFI flagging using feature matching methods available on both CPU and GPU; (2)
lofarSun.IM for interferometric imaging post-processing, including calibration with A-team sources, coordinate transformations, and 2D Gaussian source fitting; and (3) lofarSun.cli for command-line utilities for data inspection and conversion. The tools are designed to be modular and flexible, enabling high-quality radio observations of the Sun at frequencies below 240 MHz for studying, monitoring, and forecasting solar activity and space weather.