π Bring! Shopping List Tool - Discord Post
π Bring! Shopping List Tool - Python Edition
A fully embedded Python tool for managing your Bring! shopping lists - no external packages required!
β¨ Features:
β
No pip install needed - Bring! API directly embedded in code
β
Automatic authentication - Login happens automatically
β
Client caching - Faster performance through connection reuse
β
Batch operations - Multiple actions in one call
β
Essentials & Recipes - Reusable shopping list patterns
β
History tracking - Track all changes
β
100% secure - No hardcoded credentials, only environment variables
β
Optional Discord integration - Persistent storage for Essentials/Recipes
π Quick Start:
# 1. Set environment variables
export BRING_EMAIL="[email protected]"
export BRING_PASSWORD="your-password"
# 2. Use the tool
python3 bring_shopping_list_public.py
π Example Usage:
from bring_shopping_list_public import get_lists, add_item, create_essential
# Get lists
lists = get_lists()
# Add item
add_item("Tofu", list_name="Shopping List", specification="500g Organic")
# Create essential
create_essential(
"Standard Week",
["Milk", "Bread", "Eggs"],
specifications=["1 Liter", "1 Loaf", "6 Pieces"]
)
π― Available Functions:
List Management:
get_lists()- Get all listsget_list_items(list_name)- Get items from a list
Item Management:
add_item(item_name, list_name, specification)- Add itemremove_item(item_name, list_name)- Remove itemcomplete_item(item_name, list_name)- Mark as purchaseduncomplete_item(item_name, list_name)- Unmark as purchased
Batch Operations:
add_items_to_list(items, list_name)- Add multiple items at onceexecute_batch(operations)- Execute multiple operations in one call
Essentials & Recipes:
create_essential(name, items, specifications, description)- Create essentialcreate_recipe(name, items, specifications, description)- Create recipelist_essentials()/list_recipes()- List allapply_essential(name, list_name)- Apply to listdelete_essential(name)/delete_recipe(name)- Delete
History:
get_history(limit, action_filter, list_name_filter)- Get history
π Security:
- β No hardcoded credentials
- β Input validation
- β Automatic token management
- β Structured logging
πΎ Discord Integration (Optional):
For persistent storage of Essentials & Recipes:
export DISCORD_BOT_TOKEN="your-token"
export BRING_STORAGE_CHANNEL_ID="your-channel-id"
Without Discord: In-memory storage (lost on restart)
With Discord: Persistent storage in Discord channel
Note: Discord is completely optional - tool works perfectly without it!
π Batch Example:
from bring_shopping_list_public import bring_shopping_list
result = bring_shopping_list(
action="execute_batch",
operations=[
{"action": "add_item", "item_name": "Tofu", "list_name": "Shopping List"},
{"action": "add_item", "item_name": "Milk", "list_name": "Shopping List"},
{"action": "get_items", "list_name": "Shopping List"},
]
)
π Troubleshooting:
"Missing Bring! credentials"
β Make sure BRING_EMAIL and BRING_PASSWORD are set
"Login failed"
β Verify your Bring! credentials
"List not found"
β Use get_lists() to see all available lists
β οΈ Disclaimer:
Uses the unofficial Bring! API. No guarantee for stability. Use at your own risk.
π Links:
Made with β€οΈ for the Bring! Community
Questions? Issues? Pull Requests? All welcome!