Powerball Analyzer for Entertainment Purposes
A production-ready Streamlit web application that analyzes historical New York Powerball winning numbers using the official NY Open Data Socrata API.
The app provides advanced visual analytics, statistical trend scoring, probability simulations, and mobile-optimized dashboards.
Live dataset source:
https://dev.socrata.com/foundry/data.ny.gov/d6yy-54nr
Monthly frequency heatmaps for:
- White balls
- Powerball
Defined as:
Top 6 = Top 5 white balls + Top 1 Powerball
Bottom 6 = Bottom 5 white balls + Bottom 1 Powerball
Includes monthly win % trend charts.
Statistical z-score style model comparing:
- Recent draw frequency
- Long-term baseline
Highlights:
๐ฅ Hot numbers rising in frequency
๐ง Cold numbers dropping in frequency
Includes:
- Exact probability for every match pattern
- Jackpot odds
- Monte Carlo simulation sessions
Supports:
- Current Powerball rules (5 from 69 + PB from 26)
- Dataset-derived number ranges
Enter:
- 5 white balls (unordered)
- 1 Powerball
Searches the full dataset to find:
- Whether the combination ever occurred
- The exact draw dates
- In-app dark/light toggle
- Responsive layout
- Compact chart mode
- Sidebar collapses on mobile
Streamlit-native caching with:
- Configurable TTL (1โ48 hours)
- Manual force refresh
- Rate-limit protection
Download:
- Full draw history
- Long-format exploded dataset
SocrataPowerball/
โ
โโโ SocrataPowerball.py
โโโ requirements.txt
โโโ README.md
โโโ LICENSE
โโโ CONTRIBUTING.md
โ
โโโ tests/
โ โโโ test_api.py
โ
โโโ .github/
โโโ workflows/
โโโ ci.yml
requirements.txt
streamlit pandas numpy requests plotly pytest
pip install -r requirements.txt
Without a token you may hit rate limits.
export SOCRATA_APP_TOKEN="YOUR_TOKEN"
Create:
.streamlit/secrets.toml
Add:
SOCRATA_APP_TOKEN = "YOUR_TOKEN"
streamlit run SocrataPowerball.py
- Push repo to GitHub
- Visit https://share.streamlit.io
- Create new app
Main file path:
SocrataPowerball.py
- Add token in:
App โ Settings โ Secrets
SOCRATA_APP_TOKEN = "YOUR_TOKEN"
GitHub Actions automatically runs pytest:
- On every push
- On pull requests
- Daily scheduled health check
Validates:
- API availability
- Required dataset fields
This application uses publicly available data from:
New York State Open Data (powered by Socrata) Dataset: Powerball Winning Numbers https://data.ny.gov
API endpoint: https://data.ny.gov/resource/d6yy-54nr.json
All data subject to NY Open Data terms of use.
- Lottery outcomes are independent random events
- Historical trends do NOT predict future results
- Hot/Cold scoring is descriptive only
- Simulator assumes uniform randomness
This project is for educational and analytical purposes only.
This project is licensed under the MIT License.
See the LICENSE file for details.
Contributions are welcome!
Please see CONTRIBUTING.md for:
- Bug reports
- Feature requests
- Pull request workflow
- Python 3.10+
- Streamlit
- Pandas / NumPy
- Plotly
- Socrata Open Data API
- GitHub Actions CI
- Daily auto-refresh ping workflow
- Installable PWA shell
- Correlation & streak analysis
- Historical rule change handling
- Alerts for hot/cold number shifts