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.1 (Latest)

  • ๐Ÿ“š 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.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

espressonow-0.4.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: espressonow-0.4.1.tar.gz
  • Upload date:
  • Size: 19.7 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.1.tar.gz
Algorithm Hash digest
SHA256 cc4499ddf034880a086d9b3fd327f1e48e9e5abc9093585de840f75829ffb476
MD5 2ba3aa2b345bbd5fc1f9c5ce08d62f2e
BLAKE2b-256 d05358e509a44724084c0a9c87c4c7ecfade1dba85714120f0b76b8bddfc575d

See more details on using hashes here.

File details

Details for the file espressonow-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: espressonow-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for espressonow-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 151542fa7cc6769437b26b59b7b0aff2ea203f718c32e00c02d27bba5633354b
MD5 5adcd1b03dd1cef23d9c5a302b955b10
BLAKE2b-256 d066fd3d07ee4c95da3e36b8722560334afea7b6d79eb47d197ae99fcd0f5ec0

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