{"id":28372990,"url":"https://github.com/googleworkspace/python-classroom-addon","last_synced_at":"2025-06-25T12:30:47.957Z","repository":{"id":244094374,"uuid":"795698370","full_name":"googleworkspace/python-classroom-addon","owner":"googleworkspace","description":"Reference implementation of a Google Classroom add-on, written in Python and broken into steps corresponding to a walkthrough tutorial https://developers.google.com/classroom/add-ons/walkthroughs/walkthroughs-overview.","archived":false,"fork":false,"pushed_at":"2025-06-18T13:59:41.000Z","size":2743,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-18T14:42:28.578Z","etag":null,"topics":["google-classroom","google-classroom-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleworkspace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2024-05-03T20:49:44.000Z","updated_at":"2025-06-18T13:58:31.000Z","dependencies_parsed_at":"2025-06-18T14:44:50.006Z","dependency_job_id":null,"html_url":"https://github.com/googleworkspace/python-classroom-addon","commit_stats":null,"previous_names":["googleworkspace/python-classroom-addon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/googleworkspace/python-classroom-addon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleworkspace%2Fpython-classroom-addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleworkspace%2Fpython-classroom-addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleworkspace%2Fpython-classroom-addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleworkspace%2Fpython-classroom-addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleworkspace","download_url":"https://codeload.github.com/googleworkspace/python-classroom-addon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleworkspace%2Fpython-classroom-addon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261874141,"owners_count":23223070,"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":["google-classroom","google-classroom-api"],"created_at":"2025-05-29T18:38:43.289Z","updated_at":"2025-06-25T12:30:47.946Z","avatar_url":"https://github.com/googleworkspace.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Google Classroom add-ons Python Examples\n========================================\n\nThis project hosts web applications that demonstrate the implmentation of a Google\nClassroom add-on using Python. Current examples use the [Flask framework](https://flask.palletsprojects.com/en/2.0.x/).\n\nDocumentation\n-------------\n\nThese examples are intended to accompany the guided walkthroughs on the\n[Classroom Add-ons developer site](https://developers.google.com/classroom/add-ons).\nPlease refer to the site for implementation details.\n\nRequirements\n------------\n*   Python 3.7+\n\nProject Setup\n------------\n\n1.  Create a [Google Cloud Platform (GCP) project](https://console.cloud.google.com/projectcreate).\nEnable the following in the API Library:\n    *   [Google Workspace Marketplace (GWM) SDK](https://console.cloud.google.com/apis/library/appsmarket-component.googleapis.com)\n    *   [Google Classroom API](https://console.cloud.google.com/apis/library/classroom.googleapis.com)\n\n    Visit the\n    [developer site](https://developers.google.com/classroom/add-ons/developer-guides/project-configuration#step_3_google_workspace_marketplace_listing)\n    for configuration instructions for the GWM SDK. You will also need to\n    [install the add-on](https://developers.google.com/classroom/add-ons/walkthroughs/create-an-add-on#visit_the_unlisted_url_for_your_add-on_to_install_it)\n    for it to be visible in Google Classroom.\n\n1.  Visit your project's [Credentials](https://console.cloud.google.com/apis/credentials) page. Create two credentials in the project:\n    *   An **API Key**. You can leave it as **Unrestricted** for the purposes of these examples.\n    *   An **OAuth client ID**.\n        *   The application type should be **Web application**.\n        *   Add `\u003cyour server\u003e/callback` as an **Authorized redirect URI**. For example,\n        `https://localhost:5000/callback`\n\n    Return to the Credentials page once both have been created, then:\n      *   Copy your **API Key** and assign it to the environment variable `GOOGLE_API_KEY`:\n          ```shell\n          export GOOGLE_API_KEY=YOUR_COPIED_API_KEY\n          ```\n      *   Download the **OAuth2 client credentials** as JSON.\n\n1.  Install [Python 3.7+](https://www.python.org/downloads/) and ensure that `pip` is available:\n\n    ```posix-terminal\n    python -m ensurepip --upgrade\n    ```\n\n1.  Clone this repository and `cd` into the root project directory:\n\n    ```posix-terminal\n    git clone https://github.com/googleworkspace/python-classroom-addon\n    cd python-classroom-addon\n    ```\n\n1.  *(Optional, but recommended!)* Set up and activate a new Python virtual environment in\nthe python-classroom-addon directory:\n\n    ```posix-terminal\n    python3 -m venv .classroom-addon-env\n    source .classroom-addon-env/bin/activate\n    ```\n\n    When finished, use the `deactivate` command in your shell to exit the virtual environment.\n\n1.  `cd` into an example directory:\n\n    ```posix-terminal\n    cd flask/01-basic-app\n    ```\n\n1.  Install the required libraries using `pip`:\n\n    ```posix-terminal\n    pip install -r requirements.txt\n    ```\n\n1.  Inspect the `main.py` file and enable one option for running a server. For\nexample, to run the web app on `localhost`:\n\n    ```python\n    if __name__ == \"__main__\":\n        ### OPTION 1: Unsecured localhost\n        os.environ[\"OAUTHLIB_INSECURE_TRANSPORT\"] = \"1\"\n\n        # Run the application on http://localhost:5000.\n        app.run(debug=True)\n    ```\n\n1.  Launch the server by running the `main.py` file:\n\n    ```posix-terminal\n    python main.py\n    ```\n\n1.  To load your app, either open the app in your browser or select your application in the **Add-ons** menu when creating an Assignment in [Google Classroom](https://classroom.google.com).\n\nUseful Resources\n-------------\n\n*   [Issue tracker](https://github.com/googleworkspace/python-classroom-addon/issues)\n*   [Add-ons Guide](https://developers.google.com/classroom/add-ons)\n*   [Classroom API REST Reference](https://developers.google.com/classroom/reference/rest)\n*   [Using OAuth 2.0 for Web Server Applications](https://developers.google.com/identity/protocols/oauth2/web-server#creatingclient)\n*   [OAuth 2.0 Scopes](https://developers.google.com/identity/protocols/oauth2/scopes)\n*   [Google Classroom Discovery API](https://googleapis.github.io/google-api-python-client/docs/dyn/classroom_v1.html)\n*   [Google OAuth2 Discovery API](https://googleapis.github.io/google-api-python-client/docs/dyn/oauth2_v2.html)\n*   [Classroom API Support](https://developers.google.com/classroom/support)\n\nAuthors\n-------\n\n*   [Andrew Burke](https://github.com/AndrewMBurke)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleworkspace%2Fpython-classroom-addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleworkspace%2Fpython-classroom-addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleworkspace%2Fpython-classroom-addon/lists"}