Skip to main content

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:

  1. Get an API key at Google Places API
  2. Set it as an environment variable:
    export GOOGLE_PLACES_API_KEY=your_key_here
    
  3. Or create a .env file:
    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 nextPageToken to 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.4 (Latest)

  • ๐Ÿ› Compatibility Fix: Fixed Python 3.8 compatibility by updating type hints (tupleโ†’Tuple, listโ†’List)

v0.4.3

  • ๐Ÿ”ง 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 nextPageToken to 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support


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

espressonow-0.4.4.tar.gz (20.1 kB view details)

Uploaded Source

File details

Details for the file espressonow-0.4.4.tar.gz.

File metadata

  • Download URL: espressonow-0.4.4.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for espressonow-0.4.4.tar.gz
Algorithm Hash digest
SHA256 a60f062e145cd534cddd9ab3b26000db911ed513afd0f8e48761e8fa48b6eb17
MD5 747d2742196868eea6331195809d23ce
BLAKE2b-256 5d78c572493542b4d96cd8a88cdcecb3d6699c27960e09346d259b10de9d00e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page