Calendar

class O365.calendar.Attendee(address, *, name=None, attendee_type=None, response_status=None, event=None)[source]

Bases: object

A Event attendee

__init__(address, *, name=None, attendee_type=None, response_status=None, event=None)[source]

Create a event attendee

Parameters
  • address (str) – email address of the attendee

  • name (str) – name of the attendee

  • attendee_type (AttendeeType) – requirement of attendee

  • response_status (Response) – response status requirement

  • event (Event) – event for which to assign the attendee

property address

Email address

Getter

Get the email address of attendee

Setter

Set the email address of attendee

Type

str

property attendee_type

Requirement of the attendee

Getter

Get the requirement of attendee

Setter

Set the requirement of attendee

Type

AttendeeType

property name

Name

Getter

Get the name of attendee

Setter

Set the name of attendee

Type

str

property response_status

Response status of the attendee

Type

ResponseStatus

class O365.calendar.AttendeeType(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

Optional = 'optional'
Required = 'required'
Resource = 'resource'
class O365.calendar.Attendees(event, attendees=None)[source]

Bases: O365.utils.utils.ApiComponent

A Collection of Attendees

__init__(event, attendees=None)[source]

Create a collection of attendees

Parameters
  • event (Event) – event for which to assign the attendees

  • attendees (str or tuple(str, str) or Attendee or list[str] or list[tuple(str,str)] or list[Attendee]) – list of attendees to add

add(attendees)[source]

Add attendees to the parent event

Parameters

attendees (str or tuple(str, str) or Attendee or list[str] or list[tuple(str,str)] or list[Attendee]) – list of attendees to add

clear()[source]

Clear the attendees list

remove(attendees)[source]

Remove the provided attendees from the event

Parameters

attendees (str or tuple(str, str) or Attendee or list[str] or list[tuple(str,str)] or list[Attendee]) – list of attendees to add

to_api_data()[source]

Returns a dict to communicate with the server

Return type

dict

class O365.calendar.Calendar(*, parent=None, con=None, **kwargs)[source]

Bases: O365.utils.utils.ApiComponent, O365.utils.utils.HandleRecipientsMixin

__init__(*, parent=None, con=None, **kwargs)[source]

Create a Calendar Representation

Parameters
  • parent (Schedule) – parent for this operation

  • con (Connection) – connection to use if no parent specified

  • protocol (Protocol) – protocol to use if no parent specified (kwargs)

  • main_resource (str) – use this resource instead of parent resource (kwargs)

delete()[source]

Deletes this calendar

Returns

Success / Failure

Return type

bool

event_constructor

alias of Event

get_event(param)[source]

Returns an Event instance by it’s id

Parameters

param – an event_id or a Query instance

Returns

event for the specified info

Return type

Event

get_events(limit=25, *, query=None, order_by=None, batch=None, download_attachments=False, include_recurring=True)[source]

Get events from the this Calendar

Parameters
  • limit (int) – max no. of events to get. Over 999 uses batch.

  • query (Query or str) – applies a OData filter to the request

  • order_by (Query or str) – orders the result set based on this condition

  • batch (int) – batch size, retrieves items in batches allowing to retrieve more items than the limit.

  • download_attachments – downloads event attachments

  • include_recurring (bool) – whether to include recurring events or not

Returns

list of events in this calendar

Return type

list[Event] or Pagination

new_event(subject=None)[source]

Returns a new (unsaved) Event object

Return type

Event

property owner

Owner of the calendar

Return type

str

update()[source]

Updates this calendar. Only name and color can be changed.

Returns

Success / Failure

Return type

bool

class O365.calendar.CalendarColor(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

Auto = 'auto'
LightBlue = 'light_blue'
LightBrown = 'light_brown'
LightGray = 'light_gray'
LightGreen = 'light_green'
LightOrange = 'light_orange'
LightPink = 'light_pink'
LightRed = 'light_red'
LightTeal = 'light_teal'
LightYellow = 'light_yellow'
MaxColor = 'max_color'
class O365.calendar.DailyEventFrequency(recurrence_type, interval)[source]

Bases: object

__init__(recurrence_type, interval)[source]

Initialize self. See help(type(self)) for accurate signature.

class O365.calendar.Event(*, parent=None, con=None, **kwargs)[source]

Bases: O365.utils.utils.ApiComponent, O365.utils.attachment.AttachableMixin, O365.utils.utils.HandleRecipientsMixin

A Calendar event

__init__(*, parent=None, con=None, **kwargs)[source]

Create a calendar event representation

Parameters
  • parent (Calendar or Schedule or ApiComponent) – parent for this operation

  • con (Connection) – connection to use if no parent specified

  • protocol (Protocol) – protocol to use if no parent specified (kwargs)

  • main_resource (str) – use this resource instead of parent resource (kwargs)

  • calendar_id (str) – id of the calender to add this event in (kwargs)

  • download_attachments (bool) – whether or not to download attachments (kwargs)

  • subject (str) – subject of the event (kwargs)

accept_event(comment=None, *, send_response=True, tentatively=False)[source]

Accept the event

Parameters
  • comment – comment to add

  • send_response – whether or not to send response back

  • tentatively – whether acceptance is tentative

Returns

Success / Failure

Return type

bool

property attachments

List of attachments

Return type

EventAttachments

property attendees

List of meeting attendees

Return type

Attendees

property body

Body of the event

Getter

Get body text

Setter

Set body of event

Type

str

property categories

Categories of the event

Getter

get the list of categories

Setter

set the list of categories

Type

list[str]

property created

Created time of the event

Return type

datetime

decline_event(comment=None, *, send_response=True)[source]

Decline the event

Parameters
  • comment (str) – comment to add

  • send_response (bool) – whether or not to send response back

Returns

Success / Failure

Return type

bool

delete()[source]

Deletes a stored event

Returns

Success / Failure

Return type

bool

property end

End Time of event

Getter

get the end time

Setter

set the end time

Type

datetime

property event_type
get_body_soup()[source]

Returns the beautifulsoup4 of the html body

Returns

Html body

Return type

BeautifulSoup

get_body_text()[source]

Parse the body html and returns the body text using bs4

Returns

body text

Return type

str

get_occurrences(start, end, *, limit=None, query=None, order_by=None, batch=None)[source]

Returns all the occurrences of a seriesMaster event for a specified time range. :type start: datetime :param start: the start of the time range :type end: datetime :param end: the end of the time range :param int limit: ax no. of events to get. Over 999 uses batch. :type query: Query or str :param query: optional. extra filters or ordes to apply to this query :type order_by: str :param order_by: orders the result set based on this condition :param int batch: batch size, retrieves items in

batches allowing to retrieve more items than the limit.

Returns

a list of events

Return type

list[Event] or Pagination

property importance

Event Priority

Getter

get importance of event

Setter

set the importance of event

Type

ImportanceLevel

property is_all_day

Is the event for whole day

Getter

get the current status of is_all_day property

Setter

set if the event is all day or not

Type

bool

property is_online_meeting

Status of the online_meeting

Getter

check is online_meeting enabled or not

Setter

enable or disable online_meeting option

Type

bool

property is_reminder_on

Status of the Reminder

Getter

check is reminder enabled or not

Setter

enable or disable reminder option

Type

bool

property location

Location of event

Getter

get current location configured for the event

Setter

set a location for the event

Type

str

property modified

Last modified time of the event

Return type

datetime

property online_meeting_provider

online_meeting_provider of event

Getter

get current online_meeting_provider configured for the event

Setter

set a online_meeting_provider for the event

Type

OnlineMeetingProviderType

property organizer

Organizer of the meeting event

Return type

Recipient

property recurrence

Recurrence information of the event

Return type

EventRecurrence

property remind_before_minutes

No. of minutes to remind before the meeting

Getter

get current minutes

Setter

set to remind before new x minutes

Type

int

property response_requested

Is response requested or not

Getter

Is response requested or not

Setter

set the event to request response or not

Type

bool

property response_status

Your response

Return type

ResponseStatus

save()[source]

Create a new event or update an existing one by checking what values have changed and update them on the server

Returns

Success / Failure

Return type

bool

property sensitivity

Sensitivity of the Event

Getter

Get the current sensitivity

Setter

Set a new sensitivity

Type

EventSensitivity

property show_as

Show as “busy” or any other status during the event

Getter

Current status during the event

Setter

update show as status

Type

EventShowAs

property start

Start Time of event

Getter

get the start time

Setter

set the start time

Type

datetime

property subject

Subject of the event

Getter

Get subject

Setter

Set subject of event

Type

str

to_api_data(restrict_keys=None)[source]

Returns a dict to communicate with the server

Parameters

restrict_keys – a set of keys to restrict the returned data to

Return type

dict

class O365.calendar.EventAttachment(attachment=None, *, parent=None, **kwargs)[source]

Bases: O365.utils.attachment.BaseAttachment

class O365.calendar.EventAttachments(parent, attachments=None)[source]

Bases: O365.utils.attachment.BaseAttachments

class O365.calendar.EventRecurrence(event, recurrence=None)[source]

Bases: O365.utils.utils.ApiComponent

__init__(event, recurrence=None)[source]

A representation of an event recurrence properties

Parameters
  • event (Event) – event object

  • recurrence (dict) – recurrence information

property day_of_month

Repeat on this day of month

Getter

Get the repeat day of month

Setter

Set the repeat day of month

Type

int

property days_of_week

Days in week to repeat

Getter

Get the current list of days

Setter

Set the list of days to repeat

Type

set(str)

property end_date

End date of repetition

Getter

get the end date

Setter

set the end date

Type

date

property first_day_of_week

Which day to consider start of the week

Getter

Get the current start of week

Setter

Set the start day of week

Type

str

property index

Index

Getter

Get index

Setter

Set index

Type

str

property interval

Repeat interval for the event

Getter

Get the current interval

Setter

Update to a new interval

Type

int

property month

Month of the event

Getter

Get month

Setter

Update month

Type

int

property occurrences

No. of occurrences

Getter

Get the no. of occurrences

Setter

Set the no. of occurrences

Type

int

property recurrence_time_zone

Timezone to consider for repeating

Getter

Get the timezone

Setter

Set the timezone

Type

str

set_daily(interval, **kwargs)[source]

Set to repeat every x no. of days

Parameters
  • interval (int) – no. of days to repeat at

  • start (date) – Start date of repetition (kwargs)

  • end (date) – End date of repetition (kwargs)

  • occurrences (int) – no of occurrences (kwargs)

set_monthly(interval, *, day_of_month=None, days_of_week=None, index=None, **kwargs)[source]

Set to repeat every month on specified days for every x no. of days

Parameters
  • interval (int) – no. of days to repeat at

  • day_of_month (int) – repeat day of a month

  • days_of_week (list[str]) – list of days of the week to repeat

  • index – index

  • start (date) – Start date of repetition (kwargs)

  • end (date) – End date of repetition (kwargs)

  • occurrences (int) – no of occurrences (kwargs)

set_range(start=None, end=None, occurrences=None)[source]

Set the range of recurrence

Parameters
  • start (date) – Start date of repetition

  • end (date) – End date of repetition

  • occurrences (int) – no of occurrences

set_weekly(interval, *, days_of_week, first_day_of_week, **kwargs)[source]

Set to repeat every week on specified days for every x no. of days

Parameters
  • interval (int) – no. of days to repeat at

  • first_day_of_week (str) – starting day for a week

  • days_of_week (list[str]) – list of days of the week to repeat

  • start (date) – Start date of repetition (kwargs)

  • end (date) – End date of repetition (kwargs)

  • occurrences (int) – no of occurrences (kwargs)

set_yearly(interval, month, *, day_of_month=None, days_of_week=None, index=None, **kwargs)[source]

Set to repeat every month on specified days for every x no. of days

Parameters
  • interval (int) – no. of days to repeat at

  • month (int) – month to repeat

  • day_of_month (int) – repeat day of a month

  • days_of_week (list[str]) – list of days of the week to repeat

  • index – index

  • start (date) – Start date of repetition (kwargs)

  • end (date) – End date of repetition (kwargs)

  • occurrences (int) – no of occurrences (kwargs)

property start_date

Start date of repetition

Getter

get the start date

Setter

set the start date

Type

date

to_api_data()[source]

Returns a dict to communicate with the server

Return type

dict

class O365.calendar.EventResponse(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

Accepted = 'accepted'
Declined = 'declined'
NotResponded = 'not_responded'
Organizer = 'organizer'
TentativelyAccepted = 'tentatively_accepted'
class O365.calendar.EventSensitivity(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

Confidential = 'confidential'
Normal = 'normal'
Personal = 'personal'
Private = 'private'
class O365.calendar.EventShowAs(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

Busy = 'busy'
Free = 'free'
Oof = 'oof'
Tentative = 'tentative'
Unknown = 'unknown'
WorkingElsewhere = 'working_elsewhere'
class O365.calendar.EventType(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

Exception = 'exception'
Occurrence = 'occurrence'
SeriesMaster = 'series_master'
SingleInstance = 'single_instance'
class O365.calendar.OnlineMeetingProviderType(value)[source]

Bases: O365.utils.utils.CaseEnum

An enumeration.

SkypeForBusiness = 'skype_for_business'
SkypeForConsumer = 'skype_for_consumer'
TeamsForBusiness = 'teams_for_business'
Unknown = 'unknown'
class O365.calendar.ResponseStatus(parent, response_status)[source]

Bases: O365.utils.utils.ApiComponent

An event response status (status, time)

__init__(parent, response_status)[source]

An event response status (status, time)

Parameters
  • parent (Attendees or Event) – parent of this

  • response_status (dict) – status info frm cloud

class O365.calendar.Schedule(*, parent=None, con=None, **kwargs)[source]

Bases: O365.utils.utils.ApiComponent

__init__(*, parent=None, con=None, **kwargs)[source]

Create a wrapper around calendars and events

Parameters
  • parent (Account) – parent for this operation

  • con (Connection) – connection to use if no parent specified

  • protocol (Protocol) – protocol to use if no parent specified (kwargs)

  • main_resource (str) – use this resource instead of parent resource (kwargs)

calendar_constructor

alias of Calendar

event_constructor

alias of Event

get_availability(schedules, start, end, interval=60)[source]

Returns the free/busy availability for a set of users in a given time frame :param list schedules: a list of strings (email addresses) :param datetime start: the start time frame to look for available space :param datetime end: the end time frame to look for available space :param int interval: the number of minutes to look for space

get_calendar(calendar_id=None, calendar_name=None)[source]

Returns a calendar by it’s id or name

Parameters
  • calendar_id (str) – the calendar id to be retrieved.

  • calendar_name (str) – the calendar name to be retrieved.

Returns

calendar for the given info

Return type

Calendar

get_default_calendar()[source]

Returns the default calendar for the current user

Return type

Calendar

get_events(limit=25, *, query=None, order_by=None, batch=None, download_attachments=False, include_recurring=True)[source]

Get events from the default Calendar

Parameters
  • limit (int) – max no. of events to get. Over 999 uses batch.

  • query (Query or str) – applies a OData filter to the request

  • order_by (Query or str) – orders the result set based on this condition

  • batch (int) – batch size, retrieves items in batches allowing to retrieve more items than the limit.

  • download_attachments (bool) – downloads event attachments

  • include_recurring (bool) – whether to include recurring events or not

Returns

list of items in this folder

Return type

list[Event] or Pagination

list_calendars(limit=None, *, query=None, order_by=None)[source]

Gets a list of calendars

To use query an order_by check the OData specification here: http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/ part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions -complete.html

Parameters
  • limit (int) – max no. of calendars to get. Over 999 uses batch.

  • query (Query or str) – applies a OData filter to the request

  • order_by (Query or str) – orders the result set based on this condition

Returns

list of calendars

Return type

list[Calendar]

new_calendar(calendar_name)[source]

Creates a new calendar

Parameters

calendar_name (str) – name of the new calendar

Returns

a new Calendar instance

Return type

Calendar

new_event(subject=None)[source]

Returns a new (unsaved) Event object in the default calendar

Parameters

subject (str) – subject text for the new event

Returns

new event

Return type

Event