A web app and API that recommends books based on your current mood using AI and OpenLibrary.
- Enter your mood or feelings and get book recommendations.
- Uses an LLM (OpenRouter) for mood detection.
- Fetches books from OpenLibrary by mood category.
- Streamlit web interface and Flask API endpoint.
git clone https://github.com/junaidaslam2006/mood-book-recommender.git
cd mood-book-recommender
python -m venv .venv
& .venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txt
Copy .env.example to .env and add your OpenRouter API key:
OPENROUTER_API_KEY=your-key-here
streamlit run app.py
python api.py
POST to /recommend with JSON:
{
"mood_text": "I am feeling happy today"
}
Returns recommended books.
├── app.py # Streamlit app
├── api.py # Flask API
├── requirements.txt # Python dependencies
├── .env # API keys (not tracked)
├── src/
│ ├── sentiment_analysis.py
│ └── openlibrary_test.py
├── data/
│ └── book_embeddings.npy (optional)
LIVE URL : https://junaidaslam2006-mood-book-recommender-app-qcpoza.streamlit.app/