In a strong collaboration with the Swiss Data Science Center, we announce our latest publication From STEM-EDXS data to phase separation and quantification using physics-guided NMF in Machine Learning Science and Technology. In this paper, we present a detailed description of the theoretical principles and functioning of our new algorithm EsPM-NMF in the Python-based espm toolbox that is dedicated to the decomposition of EDXS datasets acquired in STEM spectrum imaging mode. Not only does this algorithm improve decomposition in the case of low signal/high noise datasets, but it further allows the user to apply a priori information to obtain improved analyses. Finally, the physics basis introduces a pathway that can be applicable to other machine learning applications.