A comprehensive command-line interface for managing Meijer shopping lists, coupons, cart, and account from the command line.
Authentication Limitation: The login method currently does not work due to security measures implemented by Meijer. Capturing a login token with a MITM (Man-in-the-Middle) proxy is the only way to authenticate. If you are unable to set up MITM proxy capture, unfortunately this project won't work for you.
- 🛒 Shopping List Management: Add, remove, organize, and estimate costs
- 🎫 Coupon Management: Browse, clip, and manage available offers
- 🛍️ Cart Operations: Add items, view contents, and manage fulfillment
- 🏪 Store Information: Search stores, view details, and find nearby locations
- ⛽ Gas Station Data: Check fuel prices and station information
- 🔐 Authentication: Token-based authentication with MITM proxy integration
- 📊 Data Export: Multiple formats (CSV, Excel, JSON, Text)
- 🎯 Cost Estimation: Smart pricing with multiple methodologies
One of the most powerful features is the defrag command, which organizes your shopping list by aisle for efficient store navigation:
1. Milk
2. Chips
3. Bread
4. Ground Turkey
5. Bananas
6. Cookies
7. Eggs
8. Apples
9. Yogurt
10. Cheese
1. Milk (Aisle: Dairy)
2. Eggs (Aisle: Dairy)
3. Yogurt (Aisle: Dairy)
4. Cheese (Aisle: Dairy)
5. Bread (Aisle: Bakery)
6. Ground Turkey (Aisle: Meat)
7. Bananas (Aisle: Produce)
8. Apples (Aisle: Produce)
9. Chips (Aisle: Snacks)
10. Cookies (Aisle: Snacks)
# Organize your shopping list by aisle
meijer list defrag --show
# Use specific store for accurate locations
meijer list defrag --store-id 217 --show# Clone the repository
git clone https://github.com/dapperfu/python_Meijer.git
cd python_Meijer
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package
pip install -e .The Meijer CLI provides a comprehensive set of commands organized into logical groups. Use meijer --help to see all available commands.
# Get help for all commands
meijer --help
# Authenticate using MITM proxy logs (required)
meijer auth log --mode full
# Add items to your shopping list
meijer list add "Milk" "Bread" "Eggs"
# Organize your list by aisle (requires old app version)
meijer list defrag --show
# View your organized list
meijer list showmeijer [OPTIONS] COMMAND [ARGS]...
Options:
--verbose, -v Increase verbosity (-v, -vv, -vvv)
--proxy TEXT Proxy server address (e.g., 127.0.0.1:8080)
--local TEXT Local Flask API backend URL
--version Show version and exit
--help Show help messageThis project uses automated documentation generation powered by Sphinx and Click. All command documentation is automatically generated from the CLI definitions.
- Interactive Help:
meijer --helpfor general help - Command Groups:
meijer list --help,meijer auth --help,meijer cart --help - Generate Full Docs:
make docs(requires dev dependencies)
- Installation Guide: Step-by-step setup instructions
- Quick Start: Get up and running in minutes
- Command Reference: Complete CLI documentation with examples
- Authentication Guide: MITM proxy setup and token extraction
- Examples: Real-world usage scenarios
- Troubleshooting: Common issues and solutions
- Development: Contributing and development setup
# Install development dependencies
pip install -e ".[dev]"
# Generate documentation
make docs
# Serve documentation locally
make docs-serve
# Live documentation updates
make docs-autobuildThe CLI is organized into logical command groups. Each group has comprehensive help:
- Shopping Lists:
meijer list --help- Add, organize, estimate, and manage shopping lists - Authentication:
meijer auth --help- Login, token management, and MITM proxy integration - Cart Management:
meijer cart --help- Add items, checkout, and fulfillment - Store Search:
meijer stores --help- Find stores, check gas prices, get store details - Coupons:
meijer coupons --help- Browse and manage available offers - Settings:
meijer settings --help- Account preferences and configuration
For detailed command documentation with examples, run:
meijer [COMMAND] --help- Command:
meijer auth log --mode full - Description: Extract complete OAuth2 flow from mitmproxy logs
- Use Case: Persistent authentication with auto-refresh
- Requirements:
- mitmproxy running on your network
- Android device configured to use proxy
- Complete login flow captured in logs
- Old version of Meijer app (newer versions removed location data)
- Command:
meijer auth log --mode quick - Description: Extract bearer tokens from recent app usage
- Use Case: Fast API access without full login
- Requirements: mitmproxy logs, recent app activity
- Command:
meijer auth log --mode auto - Description: Automatically detect best available authentication
- Use Case: Smart fallback between full and quick modes
- Requirements: mitmproxy logs, any app activity
Use --proxy flag for mitmproxy integration:
meijer --proxy 127.0.0.1:8080 list show# Add items to list
meijer list add "Milk"
meijer list add "Bread" --quantity 2
echo "Eggs" | meijer list add
# View list
meijer list show
meijer list show --pending
# Estimate costs
meijer list estimate --output estimate.csv
# Organize by aisle
meijer list defrag --show
# Remove duplicates
meijer list dedup --show# Find stores near you
meijer stores search --city "Ann Arbor"
meijer stores nearby --latitude 42.2808 --longitude -83.7430
# Check gas prices
meijer stores gas --city "Ann Arbor"
meijer gas# Add items to cart
meijer cart add 123456789012 --quantity 2
# View cart
meijer cart show
meijer cart info
# Check available slots
meijer cart slots --date 2025-08-25# Extract tokens from logs (recommended)
meijer auth log --mode full
# Quick token capture
meijer auth log --mode quick
# Check status
meijer status-
Authentication Failed
- Use
meijer auth log --mode fullfor complete OAuth2 flow - Use
meijer auth log --mode quickfor immediate token capture - Check mitmproxy logs and network connectivity
- Ensure complete login flow in Meijer app
- Use
-
Proxy Issues
- Ensure mitmproxy is running on specified port
- Check firewall settings
- Verify proxy host/port configuration
Use -v flags for detailed debugging:
meijer -v list show # Info level
meijer -vv list show # Debug level
meijer -vvv list show # Detailed debugmeijer/
├── cli/ # Command-line interface
│ ├── commands.py # All CLI commands
│ ├── main.py # CLI entry point
│ └── utils.py # CLI utilities
├── models/ # Data models
├── auth.py # Authentication core
├── client.py # Main API client
└── ...
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=meijer- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project uses modern development tools for network analysis and testing:
- Device: Google Pixel 4a
- OS: LineageOS 22 (Android 14)
- Root: Required for certificate installation
-
mitmproxy - Network traffic analysis
- Website: https://mitmproxy.org/
- GitHub: https://github.com/mitmproxy/mitmproxy
- Installation:
pip install mitmproxy - Usage:
mitmproxy -p 8080for traffic capture
-
LineageOS - Custom Android ROM
- Website: https://lineageos.org/
- GitHub: https://github.com/LineageOS
- Features: "Always Trust User Certificates" option enabled
-
Cert Fixer - Certificate management
- Purpose: Automatically installs and manages SSL certificates
- Compatibility: Works with LineageOS and mitmproxy
- GitHub: https://github.com/LineageOS/lineageos_android_packages_apps_CertFixer
- Setup: Install from F-Droid or GitHub releases
-
Network Analysis:
# Start mitmproxy mitmproxy -p 8080 # Configure device to use proxy # IP: Your computer's IP # Port: 8080
-
Certificate Installation:
- Enable "Always Trust User Certificates" in LineageOS settings
- Install mitmproxy certificate using Cert Fixer
- Verify certificate is trusted in system settings
-
Log Analysis:
# Analyze captured traffic meijer auth log --mode full --log-file /path/to/logfile # Quick token extraction meijer auth log --mode quick
The following tools are no longer recommended for development:
Old Android devices with outdated securityManual certificate installation methodsOutdated proxy tools
MIT License - see LICENSE file for details.
Comprehensive guides for capturing and analyzing Meijer API traffic:
- Makefile Logging Documentation - Complete guide to using Makefile commands for traffic capture and analysis
- Android WiFi Proxy Setup Guide - Step-by-step instructions for configuring Android devices to use proxy servers
- Traffic Capture Integration Guide - Complete workflow combining Makefile logging with Android proxy configuration
-
Start Proxy Server:
make log
-
Configure Android Device:
- Set WiFi proxy to your development machine's IP:8080
- Install mitmproxy certificate from
mitm.it
-
Capture Traffic:
- Use Meijer app on Android device
- Perform actions (login, browse, add to cart)
-
Extract Authentication:
make auth
- Documentation Overview - Complete documentation index and navigation guide
- Issues: GitHub Issues
- Documentation: GitHub Wiki
- Discussions: GitHub Discussions