1.6. pymilestone.milestoneplan.py

Module containing the class for the milestone plan.

class pymilestone.milestoneplan.Milestoneplan(include_weekend=True, today=None, custom_locale=None, **kwargs)

Main class for the milestone plan.

Parameters
  • include_weekend (boolean) – Defines, whether the weekend (Saturday, Sunday) are shown as a separate day. If both are not workdays, it is better, to set this value to False, so that for tasks ending on a friday, the end date will mark the end of the week.

  • today (datetime) – Date, at which to show the red line. If None, no red line is shown. If set, the red line will be shown at the respective date.

  • custon_locale (str) – Locale to define the language of the milestoneplan. Is important, if month names are shown. If not

  • kwargs

    Additional keyword arguments for further customization. Following keys can be used.

    Key

    Type

    Description

    c_background_top_caption

    Color

    Background color of the top caption.

    c_background_top_subcaption

    Color

    Background color of the top sub caption.

    c_background_task_caption

    Color

    Background color of the task captions.

    c_background_task_subcaption

    Color

    Background color of the tast sub captions.

    end_date

    datetime

    Last day of the milestone plan. If not provided, it will be determined automatically from the given tasks and configuration.

    fs_top_caption

    int

    Font size of the top caption. Default is 12.

    fs_top_subcaption

    int

    Font size of the top sub caption. Default is 8.

    fs_task

    int

    Font size of the task. Is also the font size of the tast caption, task sub caption, and milestone. Default is 10.

    fs_legend

    int

    Font size of the legend. Default is 10.

    key_top_caption

    str

    Defines, what is shown in the top caption. Choises are

    • "year" (shows the year),

    • "month" (shows the month).

    Default is "month".

    key_sub_caption

    str

    Defines, what is shown in the top sub caption. Choises are

    • "week" (shows the calendar week),

    • "month" (shows the month),

    • "quarter" (shows the quarter),

    Default is "month".

    start_date

    datetime

    First day of the milestone plan. If not provided, it will be determined automatically from the given tasks and configuration.

    width_col_task

    float

    Width of the column with the tasks. Default is 3.5.

    width_day

    float

    Defines the width of each single day and hence the width of the entire milestone plan.

Examples

Examples of usage can be found here: Tutorial.

add_category(elem)

Adds a category to the dictionary.

Parameters

elem (Category) – Category to add. The key must be unique, it is obtained from the given object.

add_element(elem)

Adds an element (Caption, Sub caption, Task, Milestone) to the list.

Parameters

elem (object) – Element to add. Must be either Caption, Subcaption, Task, or Milestone.

category_dict

Dictionary holding the data for the categories.

create_fig(pad=0.1)

Renders the Milestoneplan.

Parameters

pad (float) – Pad around the milestoneplan.

Returns

fig – Matplotlib figure, on which the milestoneplan was plotted.

Return type

Figure

task_list

List of the Elements. Can contain Captions, Sub captions, Tasks, and Milestones.