extract_msg.msg_classes.task Module

Module contents

class extract_msg.msg_classes.task.Task(path, **kwargs)[source]

Bases: MessageBase

Class used for parsing task files.

Supports all of the options from MSGFile.__init__() with some additional ones.

Parameters:
  • recipientSeparator – Optional, separator string to use between recipients.

  • deencapsulationFunc – Optional, if specified must be a callable that will override the way that HTML/text is deencapsulated from the RTF body. This function must take exactly 2 arguments, the first being the RTF body from the message and the second being an instance of the enum DeencapType that will tell the function what type of body is desired. The function should return a string for plain text and bytes for HTML. If any problems occur, the function must either return None or raise one of the appropriate exceptions from extract_msg.exceptions. All other exceptions must be handled internally or they will not be caught. The original deencapsulation method will not run if this is set.

getJson() str[source]

Returns the JSON representation of the Message.

property headerFormatProperties: Dict[str, str | Tuple[str | None, bool] | None | Dict[str, str | Tuple[str | None, bool] | None]] | None

Returns a dictionary of properties, in order, to be formatted into the header.

Keys are the names to use in the header while the values are one of the following:

  • None: Signifies no data was found for the property and it should be omitted from the header.

  • str: A string to be formatted into the header using the string encoding.

  • Tuple[Union[str, None], bool]: A string should be formatted into the header. If the bool is True, then place an empty string if the first value is None, otherwise follow the same behavior as regular None.

Additional note: If the value is an empty string, it will be dropped as well by default.

Additionally you can group members of a header together by placing them in an embedded dictionary. Groups will be spaced out using a second instance of the join string. If any member of a group is being printed, it will be spaced apart from the next group/item.

If you class should not do any header injection, return None from this property.

property percentComplete: float

Indicates whether a time-flagged Message object is complete.

Returns:

A percentage in decimal form. 1.0 indicates it is complete.

property taskAcceptanceState: TaskAcceptance | None

Indicates the acceptance state of the task.

property taskAccepted: bool

Indicates whether a task assignee has replied to a tesk request for this task object.

Does not indicate if it was accepted or rejected.

property taskActualEffort: int | None

Indicates the number of minutes that the user actually spent working on a task.

property taskAssigner: str | None

Specifies the name of the user that last assigned the task.

property taskAssigners: bytes | None

A stack of entries, each representing a task assigner.

The most recent task assigner (that is, the top) appears at the bottom.

The documentation on this is weird, so I don’t know how to parse it.

property taskComplete: bool

Indicates if the task is complete.

property taskCustomFlags: int | None

Custom flags set on the task.

property taskDateCompleted: datetime | None

The date when the user completed work on the task.

property taskDeadOccurrence: bool

Indicates whether a new recurring task remains to be generated.

Set to False on a new Task object and True when the client generates the last recurring task.

property taskDueDate: datetime | None

Specifies the date by which the user expects work on the task to be complete.

property taskEstimatedEffort: int | None

Indicates the number of minutes that the user expects to work on a task.

property taskFCreator: bool

Indicates that the task object was originally created by the action of the current user or user agent instead of by the processing of a task request.

property taskFFixOffline: bool

Indicates whether the value of the taskOwner property is correct.

property taskFRecurring: bool

Indicates whether the task includes a recurrence pattern.

property taskGlobalID: bytes | None

Specifies a unique GUID for this task, used to locate an existing task upon receipt of a task response or task update.

property taskHistory: TaskHistory | None

Indicates the type of change that was last made to the Task object.

property taskLastDelegate: str | None

Contains the name of the user who most recently assigned the task, or the user to whom it was most recently assigned.

property taskLastUpdate: datetime | None

The date and time of the most recent change made to the task object.

property taskLastUser: str | None

Contains the name of the most recent user to have been the owner of the task.

property taskMode: TaskMode | None

Used in a task communication.

Should be 0 (UNASSIGNED) on task objects.

property taskMultipleRecipients: TaskMultipleRecipients | None

Returns a union of flags that specify optimization hints about the recipients of a Task object.

property taskNoCompute: bool | None

This value is not used and has no impact on a Task, but is provided for completeness.

property taskOrdinal: int | None

Specifies a number that aids custom sorting of Task objects.

property taskOwner: str | None

Contains the name of the owner of the task.

property taskOwnership: TaskOwnership | None

Contains the name of the owner of the task.

property taskRecurrence: RecurrencePattern | None

Contains a RecurrencePattern structure that provides information about recurring tasks.

property taskResetReminder: bool

Indicates whether future recurring tasks need reminders.

property taskRole: str | None

This value is not used and has no impact on a Task, but is provided for completeness.

property taskStartDate: datetime | None

Specifies the date on which the user expects work on the task to begin.

property taskState: TaskState | None

Indicates the current assignment state of the Task object.

property taskStatus: TaskStatus | None

The completion status of a task.

property taskStatusOnComplete: bool

Indicates whether the task assignee has been requested to send an email message upon completion of the assigned task.

property taskUpdates: bool

Indicates whether the task assignee has been requested to send a task update when the assigned Task object changes.

property taskVersion: int | None

Indicates which copy is the latest update of a Task object.

property teamTask: bool | None

This value is not used and has no impact on a Task, but is provided for completeness.

filename: str | None