The SPEX X-ray spectral fitting package is a software tool to fit X-ray spectra. It has been optimized for high-resolution spectroscopy and is very useful for grating spectra from XMM-Newton RGS, Chandra LETG/HETG, and micro-calorimeter spectra from Hitomi Resolve. SPEX contains a wide range of spectral models, which makes it ideal for fitting X-ray spectra from any astrophysical source, observed by any X-ray observatory.

More recently, a Python interface was developed for the SPEX program, which makes it easier to script and include in Jupyter notebooks. The main advantage of SPEX is that most of the plasma models use the same atomic database and the same routines calculating the spectral processes, making it consistent across models.

Link: https://github.com/spex-xray