TimeTree API SDK for Python.
Please be aware of the following schedule for the termination of TimeTree API:
Discontinuation of New Application Creation: August 2, 2023 (Wednesday)
From this date onwards, the creation of new applications will be discontinued. This will not impact existing applications at this stage.Complete Shutdown of TimeTree API: December 22, 2023 (Friday)
On this date, all API endpoints will cease to be available, effectively halting all functionality of the API.
$ pip install timetree-sdk fromtimetree_sdkimportTimeTreeApiapi=TimeTreeApi('API_ACCESS_TOKEN') calendar=api.get_calendar('CALENDAR_ID') print(calendar.data.attributes.name) # calendar nameoauth_authorize_url=TimeTreeApi.get_oauth_authorize_url('CLIENT_ID', 'REDIRECT_URI', 'RESPONSE_TYPE', 'STATE')user=api.get_current_user() print(user.data.attributes.name) # user namecalendars=api.get_calendars() print(calendars.data[0].attributes.name) # first calendar namecalendar=api.get_calendar('CALENDAR_ID') print(calendar.data.attributes.name) # calendar namelabels=api.get_calendar_labels('CALENDAR_ID') print(labels.data[0].attributes.name) # first calendar's label namemembers=api.get_calendar_members('CALENDAR_ID') print(members.data[0].attributes.name) # first calendar's member nameevent=api.get_event('CALENDAR_ID', 'EVENT_ID') print(event.data.attributes.title) # event titleevents=api.get_upcoming_events('CALENDAR_ID', 'Asia/Tokyo', 7) print(events.data[0].attributes.title) # most recent event title in 7 daysevent=Event( data=EventData( attributes=EventAttributes( title='Title', category='schedule', all_day=False, start_at='2020-04-04T11:00:00.000Z', end_at='2020-04-04T13:00:00.000Z', description='Description', location='Location', start_timezone='Japan', end_timezone='Japan' ), relationships=EventRelationships( label=EventRelationshipsLabel( data=EventRelationshipsLabelData( id='LABEL_ID', type='label' ) ), attendees=EventRelationshipsAttendees( data=[EventRelationshipsAttendeesData( id='USER_ID', type='user' )] ) ) ) ) response=api.create_event('CALENDAR_ID', event) print(response.data.attributes.title) # Titleevent=Event( data=EventData( attributes=EventAttributes( title='Updated Title', category='schedule', all_day=False, start_at='2020-04-04T11:30:00.000Z', end_at='2020-04-04T13:30:00.000Z', description='Description', location='Location', start_timezone='Japan', end_timezone='Japan' ), relationships=EventRelationships( label=EventRelationshipsLabel( data=EventRelationshipsLabelData( id='LABEL_ID', type='label' ) ), attendees=EventRelationshipsAttendees( data=[EventRelationshipsAttendeesData( id='USER_ID', type='user' )] ) ) ) ) response=api.create_event('CALENDAR_ID', 'EVENT_ID', event) print(response.data.attributes.title) # Updated Titlestatus_code=api.delete_event('CALENDAR_ID', 'EVENT_ID') print(status_code) # 204 on successcomment=EventComment( data=EventCommentData( attributes=EventCommentAttributes( content='Hello, world' ) ) ) event_comment=api.create_event_comment('CALENDAR_ID', 'EVENT_ID', comment) print(event_comment.data.attributes.content) # Hello, worldOfficial API documentation