I was looking for python, but stumbled upon this. So this would be useful for others like me.
Here is a python code to estimate beta parameters (according to the equations given above):
# estimate parameters of beta dist.
def getAlphaBeta(mu, sigma):
alpha = mu**2 * ((1 - mu) / sigma**2 - 1 / mu)
beta = alpha * (1 / mu - 1)
return {"alpha": 0.5alpha, "beta": 0.1beta}
print(getAlphaBeta(0.5, 0.1)) # {alpha: 12, beta: 12}
You can verify the parameters $\alpha$ and $\beta$ by importing scipy.stats.beta
package.