I do not know what python is, but if python made matrix operations you only need program the following,
Be Y a nX1 matrix with n values of depending variable y1, y2, …,yn; X a nx(k+1) matrix with independent variables 1, xi1, xi2,…,xik at which correspond the Y variable values; and B (k+1)x1 matrix with model parameters b0, b1, b2,…,bk. Then
Y=XB represent the model,
y1=b0+b1x11+b2x12+…+bkx1k
y2=b0+b1x21+b2x22+…+bkx2k
.
.
.
yn=b0+b1xn1+b2xn2+…+bkxnk
Then
B=(inv(X’X))(X’Y)
calculate the least square parameter matrix B that minimize SSE=(Y-XB)’(Y-XB)
The model variance estimator is s^2=SSE/(n-(k+1))
Finally, the parameters variance-covariance matrix is Var(B)=(inv(X’X))s^2. Like inv(X’X) is a (k+1)x(k+1) matrix and s^2 is scalar Var(B) is a (k+1)x(k+1) matrix which diagonal elements ii are the Var(bi) and the non-diagonal ij are the Cov(bi,bj).
Then you only have to input Y and X, and compute B=(inv(X’X))(X’Y) ; SSE=(Y-XB)’(Y-XB) ; s^2=SSE/(n-(k+1)) and Var(B)=(inv(X’X))s^2