{"id":23057415,"url":"https://github.com/concaption/grubhub-orders-api-reporting-in-sheets","last_synced_at":"2026-01-24T07:02:23.005Z","repository":{"id":261852554,"uuid":"885533498","full_name":"concaption/grubhub-orders-api-reporting-in-sheets","owner":"concaption","description":"This project involves automating the retrieval of records from Google Sheets, generating reports based on those records, and emailing the reports to the relevant stakeholders","archived":false,"fork":false,"pushed_at":"2024-11-08T19:20:51.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T19:45:05.418Z","etag":null,"topics":["api","automation","email-sender","excel","grubhub","reports","sheets","sheets-api","spreadsheets"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/concaption.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T19:17:39.000Z","updated_at":"2024-11-08T23:39:17.000Z","dependencies_parsed_at":"2024-11-08T20:36:34.673Z","dependency_job_id":null,"html_url":"https://github.com/concaption/grubhub-orders-api-reporting-in-sheets","commit_stats":null,"previous_names":["concaption/grubhub-orders-api-reporting-in-sheets"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concaption%2Fgrubhub-orders-api-reporting-in-sheets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concaption%2Fgrubhub-orders-api-reporting-in-sheets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concaption%2Fgrubhub-orders-api-reporting-in-sheets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concaption%2Fgrubhub-orders-api-reporting-in-sheets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concaption","download_url":"https://codeload.github.com/concaption/grubhub-orders-api-reporting-in-sheets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944389,"owners_count":20858773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","automation","email-sender","excel","grubhub","reports","sheets","sheets-api","spreadsheets"],"created_at":"2024-12-16T02:12:15.706Z","updated_at":"2026-01-24T07:02:22.928Z","avatar_url":"https://github.com/concaption.png","language":"Python","readme":"# Google Sheet Automation Project\n\n## Overview\n\nThis project automates the process of managing employee and supervisor-related Google Sheets. It creates new sheets for each employee and supervisor, populates them with relevant data, and shares them with the respective users. The project utilizes the Google Sheets API and Google Drive API for sheet management and sharing.\n\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/concaption/grubhub-orders-api-reporting-in-sheets)\n\n## Features\n\n- Automatically creates individual sheets for employees and supervisors\n- Populates sheets with relevant data from a master sheet\n- Shares sheets with appropriate access levels\n- Handles duplicate sheet names gracefully\n\n```mermaid\ngraph TD\n    A[Initialize Google Sheets Manager] --\u003e B[Fetch Mapping Sheet]\n    B --\u003e C[Convert to DataFrame]\n    C --\u003e D[Process Employee Data: Split Data, Create Sheets, Update Email]\n    D --\u003e E[Share Employee Sheets with Write Access]\n    D --\u003e F[Process Supervisor Data: Group by Supervisor, Create Sheets]\n    F --\u003e G[Share Supervisor Sheets with Write Access]\n    E --\u003e H[Run Main Script: Executes Full Workflow]\n    G --\u003e H[Run Main Script: Executes Full Workflow]\n\n```\n\n## Prerequisites\n\n- Python 3.12.3 or higher\n- Google Cloud Platform account with Sheets API and Drive API enabled\n- Service account with appropriate permissions\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/concaption/grubhub-orders-api-reporting-in-sheets.git\n   cd grubhub-reporting\n   ```\n\n2. Create and activate a virtual environment:\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n   ```\n\n3. Install the required packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Set up the configuration:\n   - Copy `.env.example` to `.env` and fill in the required values\n   - Copy `service_account.json.example` to `service_account.json` and fill in your service account details\n\n## Configuration\n\n### Environment Variables\n\nCreate a `.env` file in the project root with the following variables:\n\n```\nMAPPING_SHEET='Mapping Sheet Name'\nEMPLOYEE_TEMPLATE='Template Sheet ID for Employees'\nSUPERVISOR_TEMPLATE='Template Sheet ID for Supervisors'\n```\n\n### **Environment Variables Description**\n\n-   `MAPPING_SHEET`: The name of the tab in `GH Sample Data` sheet that contains the mapping of employees and supervisors.\n-   `EMPLOYEE_TEMPLATE`: The Sheet ID of the template sheet that will be used to create employee sheets.\n-   `SUPERVISOR_TEMPLATE`: The Sheet ID of the template sheet that will be used to create supervisor sheets.\n\n### 4. Create `service_account.json` for Google Sheets API\n\nTo use the Google Sheets and Google Drive API, you will need a service account and a credentials JSON file.\n\n### Steps to Create `service_account.json`:\n\n1.  Go to the Google Cloud Console.\n2.  Create a new project or select an existing one.\n3.  Enable **Google Sheets API** and **Google Drive API** for the project:\n    -   Navigate to **APIs \u0026 Services** \u003e **Library** and search for the APIs.\n    -   Click on **Enable** for both APIs.\n4.  Create a **service account**:\n    -   Navigate to **APIs \u0026 Services** \u003e **Credentials** \u003e **Create Credentials** \u003e **Service Account**.\n    -   Assign roles like **Editor** or **Viewer** as per your needs.\n5.  Download the **JSON** key for the service account:\n    -   Once the service account is created, click on it and navigate to the **Keys** section.\n    -   Click on **Add Key** \u003e **Create New Key**, select **JSON**, and save the file as `service_account.json` in your project root directory.\n\n### Important:\n\nEnsure the Google Sheets you want to access are shared with the service account's email address (found in the `service_account.json` file).\n\n----------\n\n## Running the Project\n\n1.  Activate the virtual environment:\n    \n    -   On Windows:\n        `venv\\Scripts\\activate` \n        \n    -   On macOS/Linux:\n        `source venv/bin/activate` \n        \n2.  Run the project:    \n    `python main.py`\n\n## Project Structure\n\n```\n.\n├── main.py                   # Main script to run the project\n├── google_sheets.py           # Contains GoogleSheetManager class to manage Google Sheets and Drive\n├── custom_functions.py        # Utility functions for processing employee and supervisor data\n├── service_account.json       # Google Cloud Service Account credentials\n├── .env                       # Environment variables for the project\n├── requirements.txt           # Python dependencies\n\n```\n----------\n## Conclusion\n\nAfter setting up your virtual environment, installing the dependencies, and configuring the `.env` and `service_account.json` files, you can run the project to automate Google Sheet creation and sharing.\n\nMake sure you follow the steps carefully to avoid any issues with Google API authentication and sheet manipulation.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcaption%2Fgrubhub-orders-api-reporting-in-sheets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcaption%2Fgrubhub-orders-api-reporting-in-sheets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcaption%2Fgrubhub-orders-api-reporting-in-sheets/lists"}