๐ซ Wisdom & Poetry - An elegant web application to discover inspiring quotes and generate poetic haikus.
๐ก Want to contribute quotes? Check out our Quote Submission Guide
Donkey Quoter is a minimalist web application that allows you to:
- ๐ฒ Discover random quotes (classic, humorous, personal)
- โจ Generate poetic haikus inspired by quotes
- ๐พ Save your favorite quotes and haikus
- ๐ฅ Export your collection in JSON format
- ๐ Switch between French and English
- Classic: Proverbs and popular wisdom
- Personal: Original philosophical reflections
- Humorous: Light and amusing quotes
- Claude Haiku 3.5: Generate personalized haikus inspired by quotes using Anthropic's latest model
- Real-time generation: Create new haikus with one click with Claude Haiku 3 (5 generations per session)
- Multi-language support: Available in both French and English
- Stored haikus: Access pre-generated haikus when API is unavailable
# Clone the repository
git clone https://github.com/yourusername/donkey-quoter.git
cd donkey-quoter
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt
- streamlit >= 1.31.0: Web application framework
- pydantic >= 2.5.0: Data validation and models
- anthropic >= 0.18.0: Claude API integration for haiku generation
- python-dotenv: Environment variables management
- python >= 3.9: Required Python version
# Launch the application
streamlit run app.py
The application will automatically open in your default browser at http://localhost:8501
.
donkey-quoter/
โโโ app.py # Main entry point
โโโ src/donkey_quoter/ # Main package
โ โโโ models.py # Data models (Quote)
โ โโโ quote_manager.py # Quote management
โ โโโ haiku_generator.py # AI haiku generation
โ โโโ haiku_storage.py # Haiku persistence
โ โโโ claude_api.py # Claude API integration
โ โโโ ui_components.py # Reusable UI components
โ โโโ translations.py # FR/EN translations
โ โโโ state_manager.py # Session state management
โ โโโ config/ # Configuration modules
โ โ โโโ model_mapping.py # Claude model mappings
โ โ โโโ api_pricing.py # API pricing config
โ โโโ data/
โ โ โโโ quotes.py # Quote database
โ โโโ styles.css # Custom styles
โโโ scripts/
โ โโโ regenerate_haikus.py # Batch haiku generation
โ โโโ generate_missing_haikus.py # Generate missing haikus
โโโ data/
โ โโโ haikus.json # Generated haikus storage
โโโ tests/ # Test suite
We encourage community contributions to enrich our quote collection! You can suggest quotes in two ways:
๐ Submit via GitHub Issue (Recommended) The easiest way to contribute quotes is through our dedicated template:
- Go to Submit a Quote
- Fill in the form with your quote in both French and English
- Select the appropriate category (classic, personal, humorous)
- Submit and wait for review
โก Local Development
For testing purposes, you can modify the src/donkey_quoter/data/quotes.py
file directly:
Quote(
id="custom_001",
text={
"fr": "Votre citation en franรงais",
"en": "Your quote in English"
},
author={
"fr": "Auteur",
"en": "Author"
},
category="personal"
)
The application supports multiple Claude models for haiku generation:
Supported Models:
claude-3-5-haiku-20241022
(Claude Haiku 3.5) - Latest and fastestclaude-3-haiku-20240307
(Claude Haiku 3) - Previous version
Setup:
Local Development:
- Create a
.env
file in the project root - Add your Anthropic API key:
ANTHROPIC_API_KEY=your_key_here
- Optionally set the model:
CLAUDE_MODEL=claude-3-5-haiku-20241022
Streamlit Cloud Deployment:
- Deploy your app to Streamlit Cloud
- Go to your app's Settings โ Secrets
- Add your secrets in TOML format:
ANTHROPIC_API_KEY = "your_key_here" CLAUDE_MODEL = "claude-3-haiku-20240307"
- Save and restart your app
- Note: The app automatically uses Streamlit secrets when available, falling back to
.env
for local development
Batch Generation:
# Generate missing haikus only
python scripts/regenerate_haikus.py
# Force regeneration of all haikus
python scripts/regenerate_haikus.py --regenerate-all
# Test with a limited number of quotes
python scripts/regenerate_haikus.py --limit 5 --dry-run
Features:
- Haikus stored with metadata (date, model) in
data/haikus.json
- Real-time generation limited to 5 per session
- Fallback to stored haikus when API unavailable
Version is managed in src/donkey_quoter/__init__.py
. To release:
# Update version
__version__ = "1.2.0"
# Tag and push
git tag v1.2.0 && git push --tags
We welcome contributions! Please see our Contributing Guide for details on:
- Development setup
- Code style and quality standards
- Submitting pull requests
- Running tests
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Inspired by popular wisdom and the love of simple ๐ซ poetry.
"The patient donkey carries heavy wisdom, slow but steady steps" ๐ซ