¶
botcity.plugins.googlecalendar.BotGoogleCalendarPlugin
¶
calendar_service
property
¶
The Google Calendar account service.
__init__(credentials_file_path, calendar='primary')
¶
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(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(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
|
The ending date of the event. Defaults to 1 hour after the starting date. |
None
|
attendees
|
str
|
The list of emails that are included in the event. |
None
|
create_recurring_event(title, description, start_date, end_date=None, attendees=None, recurrence=EventRecurrence.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
|
The ending date of the event. Defaults to 1 hour after the starting date. |
None
|
attendees
|
str
|
The list of emails that are included in the event. |
None
|
recurrence
|
EventRecurrence
|
The recurrence period of the event. Usage: EventRecurrence. |
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(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(event)
¶
Delete a event from the calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event
|
The event to be deleted. |
required |
get_calendar(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:
| Name | Type | Description |
|---|---|---|
Calendar |
Calendar
|
The Calendar object. |
get_calendars()
¶
Return the calendars on the user's calendar list.
Returns:
| Type | Description |
|---|---|
List[Calendar]
|
List[Calendar]: The list containing all the Calendar objects. |
get_events(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]
|
List[Event]: The list containing all the calendar events. |
move_event(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 |
botcity.plugins.googlecalendar.EventDays
¶
Bases: Enum
botcity.plugins.googlecalendar.EventRecurrence
¶
Bases: Enum