Menu Morpher is a Python client for the Google My Business API focused on updating and downloading business menus. This tool allows businesses to easily manage and transform their menu data programmatically. No more hassle in finding your account_id, location_id, and reading Google API documentation!
Before you begin, ensure you have met the following requirements:
- Python 3.6 or higher
- pip (Python package installer)
- Completed the Prerequisites - Google Business Profile APIs
- Have your
project_idhandy - OAuth2.0 credentials requested, created, and consented
- Enabled the following (3) APIs via
APIs & Servicesthrough Google Cloud Console (GCC)
NOTE: To use the following hyperlinks, replace {your_project_id_here} with your actual project_id:
serviceName:mybusinessbusinessinformation |
version: v1
serviceName:mybusinessaccountmanagement |
version: v1
serviceName: mybusiness (aka "Google My Business") |
version: v4
Start by cloning the repository to your local machine:
git clone https://github.com/ericdwkim/Menu-Morpher.git
cd Menu-MorpherYou can set up your development environment using either venv (recommended for pure Python) or Conda (useful if you are managing dependencies that include non-Python packages).
If you don't have virtualenv installed, you can install it first:
python3 -m pip install --user virtualenv
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`Create and activate a Conda environment:
conda create --name menumorpher python=3.8
conda activate menumorpherpip install -r requirements.txtThis calls the getFoodMenus API and saves your menus locally as menu.json within your root projct directory
python -m app.__main__ --downloadThis calls the get_canHaveFoodMenus method and will inform you via console logs whether your location can update menus or not. canHaveFoodMenus_flag must yield True.
python -m app.__main__ --checkMake the necessary changes to your menu.json
This calls the updateFoodMenus API and makes the PATCH request to update morph your menus completely!
python -m app.__main__ --update