A CLI tool for finding specialty coffee shops near you
Project description
EspressoNow โ
Python CLI tool to find specialty coffee shops near your current location.
Features
- ๐ Auto-location detection - Automatically detects your current location
- ๐ Custom location search - Search near any address or coordinates
- โ Specialty coffee focus - Finds high-quality, specialty coffee shops
- ๐จ Beautiful output - Rich, colorful CLI interface with tables and progress bars
- ๐ Flexible search - Customizable search radius and result limits
- ๐บ๏ธ Google Places API integration - Real-time coffee shop data from Google's database
Installation
From Source
git clone https://github.com/ethanqcarter/EspressoNow.git
cd EspressoNow
pip install -e .
Dependencies
pip install -r requirements.txt
Quick Start
Configuration
Required: You'll need a Google Places API key to search for coffee shops:
- Get an API key at Google Places API
- Set it as an environment variable:
export GOOGLE_PLACES_API_KEY=your_key_here
- Or create a
.envfile:cp env.example .env # Edit .env and add your API key
Basic Usage
# Find coffee shops near your current location
espresso search
# Search with custom radius
espresso search --radius 5
# Search near a specific address
espresso search --location "123 Main St, San Francisco, CA"
# Search near coordinates
espresso search --location "37.7749,-122.4194"
Commands
search - Find coffee shops
espresso search [OPTIONS]
Options:
-r, --radius FLOAT Search radius (default: 3.0)
-n, --max-results INTEGER Maximum number of results (default: 10)
-l, --location TEXT Search location (address or "lat,lng")
--api-key TEXT Google Places API key
--min-rating FLOAT Minimum rating (e.g., 4.0 for >4 stars)
--exclude-chains Exclude chain coffee shops (Starbucks, Dunkin, etc.)
--specialty-only Show only specialty coffee (4+ stars, no chains) - DEFAULT
--include-all Include all coffee shops (disables specialty-only default)
--miles Use miles instead of kilometers (DEFAULT)
--km Use kilometers instead of miles
--open Show only currently open coffee shops
--export-yaml TEXT Export results to YAML file (e.g., --export-yaml results.yaml)
--help Show help message
config - Show configuration
espresso config
Shows current configuration status and setup instructions.
Examples
Find coffee shops near current location
espresso search
Search with 5-mile radius, max 20 results
espresso search --radius 5 --max-results 20
Search near specific coordinates (San Francisco)
espresso search --location "37.7749,-122.4194"
Search near coordinates (New York City)
espresso search --location "40.7128,-74.0060"
Find only specialty coffee (4+ stars, no chains)
espresso search --specialty-only
Show only currently open coffee shops
espresso search --open
Exclude chain coffee shops
espresso search --exclude-chains
Use kilometers instead of miles
espresso search --km
Use specific API key
espresso search --api-key your_google_places_api_key
Example Output
Here's what you'll see when searching for specialty coffee in San Francisco:
$ espresso search --location "37.7749,-122.4194" --radius 2 --max-results 5
Using provided coordinates: 37.7749, -122.4194
โ Searching for coffee shops...
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Search Info โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ Search Location: 37.7749, -122.4194 โ
โ ๐ Search Radius: 2.0mi โ
โ ๐ Results Found: 38 โ
โ ๐ง Filters: โญ Min Rating: 4.0 | ๐ซ Chains Excluded | โ Specialty Only (Default) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ Specialty Coffee Shops Near You
โโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโ
โ Name โ Google Maps โ Rating โ Today's Hours โ Distance โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Social Cafe โ ๐ View on Maps โ โญโญโญโญโญ (5.0) โ 7:30 AM โ 3:00 PM โ 0.9mi โ
โ Third Wheel Coffee โ ๐ View on Maps โ โญโญโญโญโญ (5.0) โ 7:00 AM โ 3:00 PM โ 0.9mi โ
โ Cable Car CoffeeSF โ ๐ View on Maps โ โญโญโญโญ (4.9) โ 4:30 AM โ 4:30 PM โ 0.9mi โ
โ Cafe Suspiro โ ๐ View on Maps โ โญโญโญโญ (4.8) โ 8:00 AM โ 3:00 PM โ 0.5mi โ
โ Unexpected Era Cafรฉ โ ๐ View on Maps โ โญโญโญโญ (4.8) โ 7:00 AM โ 3:00 PM โ 0.5mi โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโ
EspressoNow displays results in a beautiful table format showing:
- โ Name - Coffee shop name
- ๐ Google Maps - Link to view location on Google Maps
- โญ Rating - Star rating (1-5) with visual stars
- ๐ Today's Hours - Current day's opening hours with color coding (red=closed, green=open)
- ๐ Distance - Distance from search location in miles or kilometers
API Integration
Google Places API (New) with Pagination
EspressoNow uses the latest Google Places API (New) with intelligent pagination to find comprehensive coffee shop results:
- Text Search API with location bias for better coverage
- Automatic pagination using
nextPageTokento get up to 60 results - Deduplication to ensure no duplicate coffee shops
- Real-time data from Google's comprehensive database
- Detailed place information including ratings, prices, hours, and contact details
- Supports up to 50km search radius
Note: A Google Places API key is required for the application to function.
Development
Project Structure
espressonow/
โโโ __init__.py # Package initialization
โโโ cli.py # Command-line interface
โโโ core.py # Core coffee shop finding logic
โโโ location.py # Location detection and services
โโโ models.py # Data models (Pydantic)
Running Tests
# Install in development mode
pip install -e .
# Test the CLI
espresso search --help
espresso config
# Test with API key
export GOOGLE_PLACES_API_KEY=your_key_here
espresso search --location "San Francisco, CA"
Changelog
v0.4.3 (Latest)
- ๐ง Packaging Fix: Fixed PyPI installation issue by correcting license field format in pyproject.toml
v0.4.2
- ๐จ UI Enhancement: Improved table formatting with fixed column width for better coffee shop name display
v0.4.1
- ๐ Documentation: Updated README with real San Francisco output examples
- ๐งน Cleanup: Removed YAML export documentation section for cleaner focus
- โจ Better Examples: Added actual CLI output showing beautiful table formatting
- ๐ฏ Improved UX: Enhanced documentation with real-world usage examples
v0.4.0
- ๐ Enhanced Packaging: Added modern pyproject.toml configuration for better packaging standards
- ๐ฆ Build System: Enhanced build system with comprehensive dependency management
- ๐ YAML Export: Added YAML export functionality for search results
- ๐ Open Filter: Improved CLI with --open flag to filter currently open coffee shops
- ๐ Distance Units: Enhanced distance filtering with proper miles/km unit support
- ๐ API Upgrade: Upgraded to Google Places Text Search API with intelligent pagination
- ๐ฏ Better UX: Better error handling and user experience improvements
v0.3.0
- ๐ Major Performance Improvement: Implemented intelligent pagination using Google Places Text Search API
- ๐ 10x Better Coverage: Now finds 40+ coffee shops in 2km radius vs 3-4 previously
- ๐ Comprehensive Results: Uses
nextPageTokento get up to 60 results with automatic deduplication - โ Consistent Results: Smaller radius results are always included in larger radius searches
- โก Optimized API Usage: Respectful delays between paginated requests
- ๐ฏ Better Search Strategy: Switched from Nearby Search to Text Search API for superior coverage
v0.2.0
- Google Places API (New) integration
- Real-time coffee shop data
- Beautiful CLI interface with Rich library
- Auto-location detection
- Custom location search
- Chain coffee shop filtering
v0.1.0
- Initial release
- Basic coffee shop search functionality
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- ๐ Issues: GitHub Issues
Made with โ and โค๏ธ by coffee enthusiasts, for coffee enthusiasts.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file espressonow-0.4.3.tar.gz.
File metadata
- Download URL: espressonow-0.4.3.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d01b7359f68e08ba5b25efe0426e5015afb770fe76dc6335784c09fdfedfd08b
|
|
| MD5 |
3c236541edc2588fd69a28f8ad574144
|
|
| BLAKE2b-256 |
bc78bf251d319af5fdb74c1870c7673a34d9db87dd7f5522826244ffd3faff7d
|