To use relistats, first install it using pip:
(.venv) $ pip install relistats
In a python file:
from relistats.binomial import assurance
n = 22
a = assurance(n, 0) or 0
print(f"Assurance at {n} good samples: {a*100:.1f}%")
See also relistats_notebook project for how to use this library via Jupyter notebooks.