SciPy

scipy.special.psi

scipy.special.psi(z) = <ufunc 'psi'>

Digamma function

The derivative of the logarithm of the gamma function evaluated at z (also called the digamma function).