LLSQ is a Python library which solves the linear least squares problem of finding the formula of a straight line y=a*x+b which minimizes the root-mean-square error to a set of N data points.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
LLSQ is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.
TEST_LLS, a Python library which implements linear least squares (LLS) test problems of the form A*x=b.
You can go up one level to the Python source codes.