¶
botcity.plugins.googlecalendar.plugin.BotGoogleCalendarPlugin
¶
calendar_service: GoogleCalendar
property
readonly
¶
The Google Calendar account service.
__init__(self, credentials_file_path, calendar='primary')
special
¶
BotGoogleCalendarPlugin.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
credentials_file_path |
str |
The path of the credentials json file obtained at Google Cloud Platform. |
required |
calendar |
str |
The id of the calendar that will be used. Defaults to "primary". To see the id of a calendar, go to the Integrate Calendar tab in the calendar settings. |
'primary' |
create_calendar(self, title, description=None)
¶
Create a new secondary calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str |
Title of the calendar. |
required |
description |
str |
Description of the calendar. |
None |
create_event(self, title, description, start_date, end_date=None, attendees=None)
¶
Create a new event on the calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str |
The title of the event. |
required |
description |
str |
The description of the event. The text can be in HTML format. |
required |
start_date |
datetime |
The starting date of the event. |
required |
end_date(datetime, |
optional |
The ending date of the event. Defaults to 1 hour after the starting date. |
required |
attendees |
str |
The list of emails that are included in the event. |
None |
create_recurring_event(self, title, description, start_date, end_date=None, attendees=None, recurrence=<EventRecurrence.DAILY: 'DAILY'>, recurrence_freq=None, recurrence_count=None, recurrence_days=[], recurrence_until_date=None)
¶
Create a new recurring event on the calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str |
The title of the event. |
required |
description |
str |
The description of the event. The text can be in HTML format. |
required |
start_date |
datetime |
The starting date of the event. |
required |
end_date(datetime, |
optional |
The ending date of the event. Defaults to 1 hour after the starting date. |
required |
attendees |
str |
The list of emails that are included in the event. |
None |
recurrence |
EventRecurrence |
The recurrence period of the event. Usage: EventRecurrence. |
<EventRecurrence.DAILY: 'DAILY'> |
recurrence_freq |
int |
Positive integer representing how often the recurrence rule repeats. |
None |
recurrence_count |
int |
Maximum number of events created. |
None |
recurrence_days |
List[EventDays] |
Specific days for event creation. Usage: EventDays. |
[] |
recurrence_until_date |
datetime |
The end date of the event recurrence. |
None |
delete_calendar(self, calendar)
¶
Delete a secondary calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
calendar |
Calendar | str |
The calendar identifier or the Calendar object. To see the id of a calendar, go to the Integrate Calendar tab in the calendar settings. |
required |
delete_event(self, event)
¶
Delete a event from the calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
Event |
The event to be deleted. |
required |
get_calendar(self, calendar_id=None)
¶
Return the calendar with the corresponding calendar_id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
calendar_id |
str |
Calendar identifier. To see the id of a calendar, go to the Integrate Calendar tab in the calendar settings. |
None |
Returns:
Type | Description |
---|---|
Calendar |
The Calendar object. |
get_calendars(self)
¶
Return the calendars on the user's calendar list.
Returns:
Type | Description |
---|---|
List[Calendar] |
The list containing all the Calendar objects. |
get_events(self, date_min=None, date_max=None)
¶
Get all calendar events.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date_min |
datetime |
Events date is within or later than the specified date. Set this value if you want to return events that have already happened. |
None |
date_max |
datetime |
Events date is earlier or equal than the specified date. |
None |
Returns:
Type | Description |
---|---|
List[Event] |
The list containing all the calendar events. |
move_event(self, event, destination_calendar)
¶
Move a event from the calendar to another calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
Event |
The event to be moved. |
required |
destination_calendar |
str |
The id of the destination calendar. To see the id of a calendar, go to the Integrate Calendar tab in the calendar settings. |
required |