Skip to content

dutchiono/streamlit_bets

Repository files navigation

Best Bets - Sports Betting Analysis App

A Streamlit-based web application that analyzes sports betting data using RSS feeds and Google Gemini AI to provide intelligent betting insights.

Features

  • RSS Feed Processing: Automatically scrapes and parses sports odds from RSS feeds
  • AI-Powered Analysis: Uses Google Gemini AI to analyze sports data and generate betting insights
  • Interactive Dashboard: Real-time data visualization with charts and statistics
  • Data Management: Export data to CSV, backup/restore functionality, and data cleanup tools
  • Responsive UI: Modern, mobile-friendly interface built with Streamlit

Prerequisites

  • Python 3.8 or higher
  • Google Gemini API key
  • RSS feed URLs for sports data

Quick Start

Option 1: Automated Setup (Windows)

  1. Double-click launch.bat - This will automatically:
    • Check Python installation
    • Install required dependencies
    • Create config template if needed
    • Launch the application

Option 2: Manual Setup

  1. Install Python dependencies:

    pip install -r requirements.txt
  2. Configure your API key:

    • Copy config.env.example to config.env
    • Add your Gemini API key: GEMINI_API_KEY=your_api_key_here
  3. Launch the application:

    streamlit run app.py

Configuration

Environment Variables

Create a config.env file in the project root:

# Required: Your Google Gemini API key
GEMINI_API_KEY=your_api_key_here

# Optional: Debug mode
DEBUG=false

# Optional: Log level
LOG_LEVEL=INFO

RSS Feed Configuration

Add your RSS feed URLs in the Settings page of the application or modify config.py:

DEFAULT_RSS_FEEDS = [
    "https://example.com/sports-feed-1",
    "https://example.com/sports-feed-2"
]

Project Structure

STREAMLIT_MIGRATION/
├── app.py                 # Main Streamlit application
├── config.py             # Configuration management
├── requirements.txt      # Python dependencies
├── config.env           # Environment variables (create this)
├── launch.bat           # Windows launcher script
├── launch.ps1           # PowerShell launcher script
├── services/            # Core services
│   ├── rss_service.py   # RSS feed processing
│   ├── ai_service.py    # Google Gemini AI integration
│   └── data_service.py  # Data storage and management
├── utils/               # Utility functions
│   └── helpers.py       # Helper functions and charts
└── data/               # Data storage directory

Usage

Dashboard

  • View real-time sports data and statistics
  • Monitor RSS feed status and data freshness
  • Access quick actions for data management

Data Viewer

  • Browse all collected RSS data
  • Filter and search through entries
  • Export data to CSV format

AI Analysis

  • Generate AI-powered betting insights
  • Analyze specific sports events
  • View analysis history and recommendations

Settings

  • Configure RSS feed URLs
  • Manage API keys and settings
  • Data backup and restore options

Troubleshooting

Common Issues

  1. "No module named 'streamlit'"

    • Run: pip install -r requirements.txt
  2. API key not found

    • Ensure config.env exists with GEMINI_API_KEY=your_key
  3. RSS feeds not loading

    • Check feed URLs in Settings
    • Verify internet connection
    • Check feed format compatibility
  4. Data not persisting

    • Ensure data/ directory exists
    • Check file permissions

Testing

Run the test script to verify setup:

python test_app.py

Development

Adding New Features

  1. New Services: Add to services/ directory
  2. New Utils: Add to utils/ directory
  3. UI Changes: Modify app.py and add to appropriate page

Data Format

The application expects RSS feeds with sports odds data. Each entry should include:

  • Title/description with team names
  • Odds information (if available)
  • Timestamp
  • Source information

Deployment

Local Development

streamlit run app.py --server.port 8501

Production

  • Use Streamlit Cloud for easy deployment
  • Set environment variables in deployment platform
  • Ensure proper API key security

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is for educational and personal use. Please ensure compliance with local gambling laws and regulations.

Support

For issues or questions:

  1. Check the troubleshooting section
  2. Review the configuration
  3. Test with the provided test script
  4. Check Streamlit documentation for framework-specific issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published