So, I have the code, that calculates bounds of confidence interval
import statsmodels.api as sm from statsmodels.stats.proportion import proportion_confint