from scipy.stats import beta
a = 8
b = 2
p = beta.cdf(.90, a, b) # 0.7748409780000001
print(p)
We use the Cumulative density function to calculate the whole area behind the curve. This is the same as saying the probability to be less or equal.
It is easy to see the shape changing as we increase the number of experiments towards the real probability.