{"id":29373958,"url":"https://github.com/rakeshgunduka/calapi","last_synced_at":"2025-09-21T12:06:26.902Z","repository":{"id":62560663,"uuid":"370308273","full_name":"rakeshgunduka/calapi","owner":"rakeshgunduka","description":"Python Wrapper for Google Calendar API v3 to make life easier","archived":false,"fork":false,"pushed_at":"2021-06-07T19:46:50.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T10:49:35.661Z","etag":null,"topics":["google","google-calendar","google-calendar-api","google-oauth2","python"],"latest_commit_sha":null,"homepage":"https://calapi.readthedocs.io/en/latest/","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/rakeshgunduka.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}},"created_at":"2021-05-24T10:08:19.000Z","updated_at":"2021-06-07T19:52:05.000Z","dependencies_parsed_at":"2022-11-03T14:45:28.208Z","dependency_job_id":null,"html_url":"https://github.com/rakeshgunduka/calapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rakeshgunduka/calapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakeshgunduka%2Fcalapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakeshgunduka%2Fcalapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakeshgunduka%2Fcalapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakeshgunduka%2Fcalapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rakeshgunduka","download_url":"https://codeload.github.com/rakeshgunduka/calapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakeshgunduka%2Fcalapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502494,"owners_count":23618619,"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","google-calendar","google-calendar-api","google-oauth2","python"],"created_at":"2025-07-09T19:40:44.759Z","updated_at":"2025-09-21T12:06:21.862Z","avatar_url":"https://github.com/rakeshgunduka.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calapi 1.0.0\n\nA light weight python wrapper for [Google's Calendar API v3](https://developers.google.com/calendar/v3/reference) written upon [Google's API Python Client](https://github.com/google/google-api-python-client).\n\n# Features provided by Calapi\n- Documented functions and usage instructions.\n- Pythonic style usage.\n\n# Installation\nTo install, simply use `pip` or `easy_install`:\n\n```bash\n$ pip install calapi\n```\nor\n```bash\n$ easy_install calapi\n```\n\n# Acquire Google Oauth credentials\n\n**1.  Create a new project on google console dashboard on below link**\n\nhttps://console.cloud.google.com/apis/dashboard\n\n**2.  Enable Google Calendar API on the below link**\n\nhttps://console.cloud.google.com/apis/library/calendar-json.googleapis.com\n\n**3.  Configure Oauth Consent Screen**\n\n- Open Link https://console.cloud.google.com/apis/credentials/consent\n- Click on \"OAuth Consent screen\"\n- Select User Type and click create\n- Provide app name, email and proceed\n- Add Required scopes based on your use case\n- Proceed and complete the process\n\n**3.  Create Oauth Client ID credentials for Users consent**\n\n- Open Link https://console.cloud.google.com/apis/credentials/consent\n- Click on \"+ Create Credentials\"\n- Select \"OAuth client ID\"\n- Select Application Type \"Web Application\"\n- Provide name, authorized javascript URIs, authorized redirect URIs and create\n- Download the credentials\n\n------------\n\n# Get Started\n\n#### Instantiate Calapi Oauth Instance\n\n    from calapi import Oauth\n    client = Oauth(\n        credentials_path='./credentials.json',\n        scopes=[\n            'openid',\n            'https://www.googleapis.com/auth/userinfo.email',\n            'https://www.googleapis.com/auth/userinfo.profile',\n            'https://www.googleapis.com/auth/calendar.events',\n            'https://www.googleapis.com/auth/calendar',\n            'https://www.googleapis.com/auth/calendar.readonly'\n        ]\n    )\n        \n#### Get Users consent for Calendar Access\n**(Note: Users Consent is required for accessing user calendar)**\n\n    # Redirect URL to which google will callback with state and code\n    callback_url = 'https://yourdomain.com/api/v1/google/calendar/callback'\n\n    # Use `oauth_consent_url` to get user's consent\n    oauth_consent_url = client.get_authorization_url(redirect_uri=callback_url)\n\n#### Fetch User's Access Token using Google's callback after users consent\n**(Google will callback on provided redirect_uri)**\n\n    # Upon Googles Oauth callback, get state \u0026 code from query params\n    state = request.args.get('state')\n    code = request.args.get('code')\n    \n    # Call this function on google's callback after users consent\n    session_credentials = client.on_auth_callback(state, code)\n\n    # Store Users session credentials in DB for performing actions on user's Calendar\n\n#### Instantiate Session Object for user\n\n    from calapi import Session\n    session = Session(session_credentials=session_credentials)\n\n## Using Events API \n**(Refer Google's docs: https://developers.google.com/calendar/v3/reference/events)**\n**(Get all the usage information for events api using below line)**\n\n    help(session.events)\n\n### Create Event on Users Calendar\n\n    # Generate query for inserting\n    query = session.events.query.start(\n                date_time='2021-06-03T09:00:00-07:00',\n                time_zone='America/Los_Angeles'\n            ).end(\n                date_time='2021-06-03T09:30:00-07:00',\n                time_zone='America/Los_Angeles'\n            ).attendees([\n                {'email': 'lp_age@example.com'},\n                {'email': 'sbrin@example.com'},\n            ]).summary(\n                'Google I/O 2015'\n            ).description(\n                '800 Howard St., San Francisco, CA 94103'\n            ).recurrence([\n                'RRULE:FREQ=DAILY;COUNT=2'\n            ]).reminders({\n                'use_default': False,\n                'overrides': [\n                    {'method': 'email', 'minutes': 24 * 60},\n                    {'method': 'popup', 'minutes': 10},\n                ],\n            })\n    # Insert to the calendar\n    created_event = session.events.insert(query)\n\n### Get Event using event id\n\n    event = session.events.get(event_id)\n\n### Update Event using event id\n\n    query = session.events.query.summary(\n                    'Updated summary Google I/O 2015'\n                ).description(\n                    'Updated description 800 Howard St., San Francisco, CA 94103'\n                )\n    resp = session.events.update(event_id, query)\n\n### Delete Event\n\n    resp = session.events.delete(event_id)\n\n\n## Using Calendars API \n**(Refer Google's docs: https://developers.google.com/calendar/v3/reference/calendars)**\n\n### **Get all the usage information for calendars api using below line**\n\n    help(session.calendars)\n\n### Create Secondary Calendar\n\n    # Generate query for inserting\n    query = session.events.query.summary(\n                'calendarSummary'\n            ).time_zone(\n                'America/Los_Angeles'\n            )\n    # Insert Secondary calendar\n    calendar = session.calendars.insert(query)\n\n#### Get metadata for a calendar\n\n    resp = session.calendars.get(calendar_id)\n\n#### Update metadata for a calendar\n\n    query = session.calendars.query.summary(\n                        'New Summary'\n                    )\n    resp = session.calendars.update(query)\n        \n\n#### Delete a secondary calendar\n\n    resp = session.calendars.delete(event_id)\n\n## For all the apis, calapi provides all the usage information in respected help function\n### **To learn about the usage for other apis, use below lines of code**\n\n\n    # For Oauth usage instruction\n    help(calapi.Oauth)\n\n    # For Session usage instruction\n    help(calapi.Session)\n\n    # For ACL Api usage instruction\n    help(session.acl)\n\n    # For Calendar List Api usage instruction\n    help(session.calendarlist)\n\n    # For Calendars Api usage instruction\n    help(session.calendars)\n\n    # For Settings Api usage instruction\n    help(session.settings)\n\n    # For Colors Api usage instruction\n    help(session.colors)\n\n    # For Events Api usage instruction\n    help(session.events)\n\n\n**(Note: I tried to cover all the basic details which are required by each api in the docs. If there are any missing docs, please feel free to report in the issue section)**\n\n------\n\n## Third Party Libraries and Dependencies\nThe following libraries will be installed when you install the client library:\n* [google-api-python-client](https://github.com/google/google-api-python-client) (Google Client Library)\n* [google-auth](https://github.com/GoogleCloudPlatform/google-auth-library-python/) (Google Auth Library)\n* [google-auth-oauthlib](https://github.com/googleapis/google-auth-library-python-oauthlib) (This library provides oauthlib integration with google-auth)\n* [google-auth-httplib2](https://github.com/googleapis/google-auth-library-python-httplib2) (This library provides an httplib2 transport for google-auth.)\n\n## To-Dos\n- Test cases.\n\n## Contribute\n1. Look for an open [issue](https://github.com/rakeshgunduka/calapi/issues) or create new issue to get a dialog going about the new feature or bug that you've discovered.\n2. Fork the [repository](https://github.com/rakeshgunduka/calapi) on Github to start making your changes to the master branch (or branch off of it).\n3. Write a test which shows that the bug was fixed or that the feature works as expected.\n4. Make a pull request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakeshgunduka%2Fcalapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frakeshgunduka%2Fcalapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakeshgunduka%2Fcalapi/lists"}