Installation
ToFUL can be used in two ways: through the hosted web application (no installation required) or by running it locally on your own machine.
Option 1 — Hosted Web App
The fastest way to use ToFUL is the hosted Streamlit application. No installation, no dependencies, works on any device with a browser.
Option 2 — Local Installation
Requirements
Python 3.9 or later
pip
Step 1 — Clone the repository
git clone https://github.com/pranava-ba/ToFUL.git
cd ToFUL
Step 2 — Install dependencies
pip install -r requirements.txt
The requirements.txt includes:
streamlit>=1.32.0
numpy>=1.24.0
scipy>=1.11.0
sympy>=1.12
mpmath>=1.3.0
plotly>=5.18.0
pandas>=2.0.0
Step 3 — Run the app
streamlit run app.py
The app will open automatically in your browser at http://localhost:8501.
Note
All three files — app.py, core.py, and toful_parser.py — must
be in the same directory when you run the app.
Option 3 — Virtual Environment (Recommended)
Using a virtual environment keeps ToFUL’s dependencies isolated from your system Python.
# Create environment
python -m venv toful-env
# Activate it
source toful-env/bin/activate # macOS / Linux
toful-env\Scripts\activate # Windows
# Install and run
pip install -r requirements.txt
streamlit run app.py
Verifying the Installation
To confirm everything is working correctly without launching the UI:
python -c "
import core, toful_parser
import numpy as np
x, _, _ = core.parse_range_input('0,1,2,3,...')
vr = core.validate_drv_probabilities(
'0.3*(0.7**x) if x>=0 else 0', x[:200], True
)
print('Valid:', vr.is_valid)
print('Sum: ', round(vr.integral_or_sum, 6))
"
Expected output:
Valid: True
Sum: 1.0
Optional Dependencies
ToFUL automatically uses these packages when available for higher precision
and symbolic computation. They are included in requirements.txt but
can also be installed separately:
sympyEnables exact symbolic moment computation for distributions without
if/elseconditionals (e.g. Normal, Beta). Falls back gracefully to numerical integration if not installed.mpmathEnables arbitrary-precision integration for display precision above 12 decimal places. Falls back to SciPy
quadif not installed.
Next Steps
Quick Start Guide — calculate your first moments in under 5 minutes
Input Syntax Guide — learn the expression syntax ToFUL accepts