Registry / productivity / gcsa
library2.6.0pypypi✓ verified 85d ago

A simple Python library for managing Google Calendar events, written with type hints and asynchronous support. Version 2.6.0 is the latest stable release with weekly releases.

pip install gcsa
INSTALL
IMPORT
SIG · GCSA
G
gcsa
productivitypythonv2.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GoogleCalendar
from gcsa.google_calendar import GoogleCalendar
from gcsa import GoogleCalendar
GoogleCalendar is not at top-level package
Event
from gcsa.event import Event
from gcsa import Event
Event class is in submodule
Recurrence
from gcsa.recurrence import Recurrence
from gcsa import Recurrence
Recurrence is not imported at package root

Creates a calendar instance, adds a sample event, and lists all events.

import os from gcsa.google_calendar import GoogleCalendar from gcsa.event import Event # Replace with your credentials file path or use environment variable CREDENTIALS_PATH = os.environ.get('GCAL_CREDENTIALS', 'credentials.json') # Initialize calendar (default: primary) gcal = GoogleCalendar(credentials_path=CREDENTIALS_PATH) # Create an event event = Event( summary='Test Event', start='2026-07-01T10:00:00', end='2026-07-01T11:00:00', timezone='America/New_York' ) gcal.add_event(event) # List events for e in gcal.get_events(): print(e.summary, e.start, e.end)
Debug
Known issues
breakingVersion 2.0+ removed the old OAuth flow. Now requires credentials.json from Google Cloud Console.
fix
Use Google Cloud Console to create OAuth2 credentials and download as credentials.json.
affects: >=2.0
deprecatedThe `google_calendar` module attribute `credentials_path` is deprecated; use `creds` or `credentials` parameter instead.
fix
Use `GoogleCalendar(credentials=...)` with a pre-built Credentials object.
affects: >=2.5
gotchaDo not set `timezone` on Event if you use DateTime objects; pass tz-aware datetimes instead.
fix
Use `datetime.datetime(2026, 7, 1, 10, 0, 0, tzinfo=pytz.timezone('America/New_York'))` and omit `timezone` parameter.
affects: all
Errors
Common errors & fixes
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://www.googleapis.com/calendar/v3/calendars/primary/events
Often caused by invalid or expired credentials, or the calendar ID is wrong.
fix
Regenerate credentials.json from Google Cloud Console, ensure the Calendar API is enabled, and use correct calendar ID.
google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant'})
The refresh token has expired or the credentials file is outdated.
fix
Delete the token.pickle file (or cache) and re-authenticate by running the script again.
Upgrade
Version history
2.6.0latest on PyPI · released Aug 22, 2025
Audit
Dependencies
google-api-python-clientrequiredRequired for Google API interaction
google-auth-oauthlibrequiredOAuth2 authentication flow
google-auth-httplib2requiredHTTP transport for google-auth
Agent activity
33 hits · last 30 days
node
28
OpenAI (training)
1
Resources
gcsa — pip install gcsa · libregistry