Planner

class O365.planner.Bucket(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

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

A Microsoft O365 bucket

Parameters:
  • parent (Planner or Plan) – parent object

  • 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)

create_task(title, assignments=None, **kwargs)[source]

Creates a Task

Parameters:
  • title (str) – the title of the task

  • assignments (dict) – the dict of users to which tasks are to be assigned.

e.g. assignments = {
      "ca2a1df2-e36b-4987-9f6b-0ea462f4eb47": null,
      "4e98f8f1-bb03-4015-b8e0-19bb370949d8": {
          "@odata.type": "microsoft.graph.plannerAssignment",
          "orderHint": "String"
        }
    }
if "user_id": null -> task is unassigned to user.
if "user_id": dict -> task is assigned to user
Parameters:
  • kwargs (dict) – optional extra parameters to include in the task

  • priority (int) –

    priority of the task. The valid range of values is between 0 and 10.

    1 -> “urgent”, 3 -> “important”, 5 -> “medium”, 9 -> “low” (kwargs)

  • order_hint (str) – the order of the bucket. Default is on top (kwargs)

  • start_date_time (datetime or str) – the starting date of the task. If str format should be: “%Y-%m-%dT%H:%M:%SZ” (kwargs)

  • due_date_time (datetime or str) – the due date of the task. If str format should be: “%Y-%m-%dT%H:%M:%SZ” (kwargs)

  • conversation_thread_id (str) –

    thread ID of the conversation on the task.

    This is the ID of the conversation thread object created in the group (kwargs)

  • assignee_priority (str) – hint used to order items of this type in a list view (kwargs)

  • percent_complete (int) – percentage of task completion. When set to 100, the task is considered completed (kwargs)

  • applied_categories (dict) –

    The categories (labels) to which the task has been applied.

    Format should be e.g. {“category1”: true, “category3”: true, “category5”: true } should (kwargs)

Returns:

newly created task

Return type:

Task

delete()[source]

Deletes this bucket

Returns:

Success / Failure

Return type:

bool

list_tasks()[source]

Returns list of tasks that given plan has :rtype: list[Task]

update(**kwargs)[source]

Updates this bucket

Parameters:

kwargs – all the properties to be updated.

Returns:

Success / Failure

Return type:

bool

name

Name of the bucket.

   Type: str

object_id

ID of the bucket.

   Type: str

order_hint

Hint used to order items of this type in a list view.

   Type: str

plan_id

Plan ID to which the bucket belongs.

   Type: str

class O365.planner.Plan(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

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

A Microsoft O365 plan

Parameters:
  • parent (Planner) – parent object

  • 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)

create_bucket(name, order_hint=' !')[source]

Creates a Bucket

Parameters:
Returns:

newly created bucket

Return type:

Bucket

delete()[source]

Deletes this plan

Returns:

Success / Failure

Return type:

bool

get_details()[source]

Returns Microsoft O365/AD plan with given id

Return type:

PlanDetails

list_buckets()[source]

Returns list of buckets that given plan has :rtype: list[Bucket]

list_tasks()[source]

Returns list of tasks that given plan has :rtype: list[Task] or Pagination of Task

update(**kwargs)[source]

Updates this plan

Parameters:

kwargs – all the properties to be updated.

Returns:

Success / Failure

Return type:

bool

created_date_time

Date and time at which the plan is created.

   Type: datetime

group_id

The identifier of the resource that contains the plan.

   Type: str

object_id

ID of the plan.

   Type: str

title

Title of the plan.

   Type: str

class O365.planner.PlanDetails(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

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

A Microsoft O365 plan details

Parameters:
  • parent (Plan) – parent object

  • 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)

update(**kwargs)[source]

Updates this plan detail

Parameters:
  • kwargs – all the properties to be updated.

  • shared_with (dict) – dict where keys are user_ids and values are boolean (kwargs)

  • category_descriptions (dict) – dict where keys are category1, category2, …, category25 and values are the label associated with (kwargs)

Returns:

Success / Failure

Return type:

bool

category_descriptions

An object that specifies the descriptions of the 25 categories that can be associated with tasks in the plan.

   Type: any

object_id

The unique identifier for the plan details.

   Type: str

shared_with

Set of user IDs that this plan is shared with.

   Type: any

class O365.planner.Planner(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

A microsoft planner class

In order to use the API following permissions are required. Delegated (work or school account) - Group.Read.All, Group.ReadWrite.All

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

A Planner object

Parameters:
  • parent (Account) – parent object

  • 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)

create_plan(owner, title='Tasks')[source]

Creates a Plan

Parameters:
  • owner (str) – the id of the group that will own the plan

  • title (str) – the title of the new plan. Default set to “Tasks”

Returns:

newly created plan

Return type:

Plan

get_bucket_by_id(bucket_id=None)[source]

Returns Microsoft O365/AD plan with given id

Parameters:

bucket_id – bucket id of buckets

Return type:

Bucket

get_my_tasks(*args)[source]

Returns a list of open planner tasks assigned to me

Return type:

tasks

get_plan_by_id(plan_id=None)[source]

Returns Microsoft O365/AD plan with given id

Parameters:

plan_id – plan id of plan

Return type:

Plan

get_task_by_id(task_id=None)[source]

Returns Microsoft O365/AD plan with given id

Parameters:

task_id – task id of tasks

Return type:

Task

list_group_plans(group_id=None)[source]

Returns list of plans that given group has :param group_id: group id :rtype: list[Plan]

list_user_tasks(user_id=None)[source]

Returns Microsoft O365/AD plan with given id

Parameters:

user_id – user id

Return type:

list[Task]

class O365.planner.Task(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

A Microsoft Planner task

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

A Microsoft planner task

Parameters:
  • parent (Planner or Plan or Bucket) – parent object

  • 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 task

Returns:

Success / Failure

Return type:

bool

get_details()[source]

Returns Microsoft O365/AD plan with given id

Return type:

PlanDetails

update(**kwargs)[source]

Updates this task

Parameters:

kwargs – all the properties to be updated.

Returns:

Success / Failure

Return type:

bool

active_checklist_item_count

Number of checklist items with value set to false, representing incomplete items.

   Type: int

applied_categories

The categories to which the task has been applied.

   Type: plannerAppliedCategories

assignee_priority

Hint used to order items of this type in a list view.

   Type: str

assignments

The set of assignees the task is assigned to.

   Type: plannerAssignments

bucket_id

Bucket ID to which the task belongs.

   Type: str

checklist_item_count

Number of checklist items that are present on the task.

   Type: int

completed_date

Date and time at which the ‘percentComplete’ of the task is set to ‘100’.

   Type: datetime

conversation_thread_id

Thread ID of the conversation on the task.

   Type: str

created_date

Date and time at which the task is created.

   Type: datetime

due_date_time

Date and time at which the task is due.

   Type: datetime

has_description

Value is true if the details object of the task has a nonempty description and false otherwise.

   Type: bool

object_id

ID of the task.

   Type: str

order_hint

Hint used to order items of this type in a list view.

   Type: str

percent_complete

Percentage of task completion.

   Type: int

plan_id

Plan ID to which the task belongs.

   Type: str

preview_type

his sets the type of preview that shows up on the task. The possible values are: automatic, noPreview, checklist, description, reference.

   Type: str

priority

Priority of the task.

   Type: int

reference_count

Number of external references that exist on the task.

   Type: int

start_date_time

Date and time at which the task starts.

   Type: datetime

title

Title of the task.

   Type: str

class O365.planner.TaskDetails(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

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

A Microsoft O365 plan details

Parameters:
  • parent (Task) – parent object

  • 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)

update(**kwargs)[source]

Updates this task detail

Parameters:
  • kwargs – all the properties to be updated.

  • checklist (dict) – the collection of checklist items on the task.

e.g. checklist = {
  "string GUID": {
    "isChecked": bool,
    "orderHint": string,
    "title": string
  }
} (kwargs)
Parameters:
  • description (str) – description of the task

  • preview_type (str) –

    this sets the type of preview that shows up on the task.

    The possible values are: automatic, noPreview, checklist, description, reference.

  • references (dict) – the collection of references on the task.

e.g. references = {
  "URL of the resource" : {
    "alias": string,
    "previewPriority": string, #same as orderHint
    "type": string, #e.g. PowerPoint, Excel, Word, Pdf...
  }
}
Returns:

Success / Failure

Return type:

bool

checklist

The collection of checklist items on the task.

   Type: any

description

Description of the task.

   Type: str

object_id

ID of the task details.

   Type: str

preview_type

This sets the type of preview that shows up on the task. The possible values are: automatic, noPreview, checklist, description, reference. When set to automatic the displayed preview is chosen by the app viewing the task.

   Type: str

references

The collection of references on the task.

   Type: any