MCALF is an open-source Python package for accurately constraining velocity information from spectral imaging observations using machine learning techniques. This software package provides a ‘toolkit’ that can be used to define a spectral model optimised for a particular dataset. A sample model is provided for an IBIS Ca II 8542 Å spectral imaging sunspot dataset. This dataset typically contains spectra with multiple atmospheric components and this package supports the isolation of the individual components such that velocity information can be constrained for each component. Using this sample model, as well as the separate base (template) model it is built upon, a custom model can easily be built for a specific dataset.