A powerful Python CLI tool for discovering and managing cocktail recipes from Difford's Guide. Search for cocktails, get detailed ingredient lists, and export recipes to various formats.
- Smart Search: Fuzzy matching to find cocktails even with typos
- Multiple Output Formats: JSON, Markdown, Table, Pretty, Simple, and Compact formats
- Interactive Mode: Choose from multiple matches when searching
git clone https://github.com/yourusername/diffords-finder.git
cd diffords-finder
pip install -e .git clone https://github.com/yourusername/diffords-finder.git
cd diffords-finder
pip install -e ".[dev]"
pre-commit install # Install git hooksSearch for a cocktail and display ingredients:
diffords mojito# Pretty format with numbering (default)
diffords "old fashioned" --format pretty
# Simple bullet list
diffords margarita --format simple
# Compact one-line format
diffords manhattan --format compact
# Table format
diffords "whiskey sour" --format table
# Markdown format
diffords negroni --format markdown
# JSON output for programmatic use
diffords martini --format json# Save as JSON
diffords "mai tai" -o cocktail.json
# Save as text
diffords daiquiri --format markdown -o recipe.mdSkip the selection prompt and use best match:
diffords "gin fizz" --non-interactiveMojito
=========
Ingredients:
1. 2 oz White rum
2. 1 oz Fresh lime juice
3. 2 tsp Sugar
4. 6-8 Mint leaves
5. Top Soda water
Recipe URL: https://www.diffordsguide.com/cocktails/recipe/1376/mojito
{
"name": "Mojito",
"url": "https://www.diffordsguide.com/cocktails/recipe/1376/mojito",
"search_query": "mojito",
"match_confidence": 1.0,
"ingredients": {
"White rum": {"measure": "2", "unit": "oz"},
"Fresh lime juice": {"measure": "1", "unit": "oz"},
"Sugar": {"measure": "2", "unit": "tsp"},
"Mint leaves": {"measure": "6-8", "unit": ""},
"Soda water": {"measure": "Top", "unit": ""}
}
}# Set logging level
export DIFFORDS_LOG_LEVEL=DEBUG
# Set default output format
export DIFFORDS_DEFAULT_FORMAT=markdown
# Set request timeout (seconds)
export DIFFORDS_TIMEOUT=15The tool respects rate limiting and uses polite scraping practices by default. You can adjust the delay between requests:
from diffords_finder.core import CocktailScraper
scraper = CocktailScraper(delay=2.0) # 2 seconds between requestsThis project is licensed under the MIT License - see the LICENSE file for details.
This tool is for personal use only. Please respect Difford's Guide's terms of service and robots.txt file. The tool implements rate limiting and polite scraping practices by default. Always attribute recipes to Difford's Guide when sharing.
- Difford's Guide for their comprehensive cocktail database