This paper presents the development of a mathematical model for a direct-expansion solar-assisted heat pump (DX-SAHP) operating in steady-state. The mathematical model was implemented using the scientific software EES and using a code written in Python. It was utilized a lumped parameter model for the heat exchangers and a semi-empirical model for the compressor. The mathematical model was validated using experimental data of a DX-SAHP running with R134a. Two hundred simulations were made combining different correlations for estimating the convective heat transfer coefficient in the evaporator/collector. The Mean Absolute Deviation (MAD) and the Mean Deviation (MD) between the theoretical and experimental values for the COP were 2.6±1.8 % and 0.9±1.8 %, respectively. The MAD and MD between the discharge temperature were 1.56±0.16 % and -1.45±0.16 %. The mean difference between the results using EES and Python were 1.4 %. The use of Python with parallel computing for uncertainty analyses, reduced the simulation time in 88 % if compared with EES. The model in Python is available as open-source through the platform Google Colaboratory.