flower_reports_llm

Flower Reports LLM

This project scrapes and parses flowering report data from various websites, processes it using a Large Language Model (LLM), and displays the results on an interactive map.

Live Site: https://baobabprince.github.io/flower_reports_llm/

Project Structure

Setup and Installation

  1. Clone the repository:
    git clone https://github.com/your-username/flower_reports_llm.git
    cd flower_reports_llm
    
  2. Install the required dependencies:
    pip install -r requirements.txt
    
  3. Set up your environment variables:
    • Create a .env file by copying the .env.example file:
      cp .env.example .env
      
    • Open the .env file and add your API keys for the Gemini API and the LocationIQ API.

Running the Application

  1. Run the data processing pipeline: To perform an initial run of the data processing pipeline, execute the following command:
    python3 pipeline.py
    

    This will scrape the data, process it, and create the wildflowers_data.json file.

  2. Run the background worker (optional): To keep the data up-to-date automatically, you can run the background worker in a separate terminal:
    python3 background_worker.py
    
  3. Run the Flask application:
    python3 flask_app.py
    

    The application will be available at http://127.0.0.1:5000.

Testing

To run the unit tests, execute the following command:

python3 -m unittest discover tests

Automated Scraping

This project uses a GitHub Action to automatically scrape the data daily. To enable this, you need to add the following secrets to your GitHub repository:

The workflow is defined in .github/workflows/scrape.yml.