PyShift Work Schedule
Work Schedule for Python
Public Member Functions | Public Attributes | List of all members
team.Team Class Reference

Class Team is a named group of individuals who rotate through a shift schedule. More...

Inheritance diagram for team.Team:

Public Member Functions

def __init__ (self, str name, str description, Rotation rotation, date rotationStart)
 Construct a team. More...
 
timedelta getRotationDuration (self)
 Get the duration of the shift rotation. More...
 
float getPercentageWorked (self)
 Get the shift rotation's working time as a percentage of the rotation duration. More...
 
float getAverageHoursWorkedPerWeek (self)
 Get the average number of hours worked each week by this team. More...
 
int getDayInRotation (self, date day)
 Get the day number in the rotation for this date. More...
 
ShiftInstance getShiftInstanceForDay (self, date day)
 Get the ShiftInstance for the specified day. More...
 
bool isDayOff (self, date day)
 Check to see if this day is a day off. More...
 
timedelta calculateWorkingTime (self, datetime fromTime, datetime toTime)
 Calculate the team working time between the specified dates and times of day. More...
 
str __str__ (self)
 

Public Attributes

 rotation
 
 rotationStart
 

Detailed Description

Class Team is a named group of individuals who rotate through a shift schedule.

Constructor & Destructor Documentation

◆ __init__()

def team.Team.__init__ (   self,
str  name,
str  description,
Rotation  rotation,
date  rotationStart 
)

Construct a team.

Parameters
nameName of team
descriptionDescription of team
rotationRotation of this team
rotationStartDate that the rotation starts for this team

Member Function Documentation

◆ calculateWorkingTime()

timedelta team.Team.calculateWorkingTime (   self,
datetime  fromTime,
datetime  toTime 
)

Calculate the team working time between the specified dates and times of day.

Parameters
fromTimeStarting date and time of day
toTimeEnding date and time of day
Returns
Duration of working time as timedelta

◆ getAverageHoursWorkedPerWeek()

float team.Team.getAverageHoursWorkedPerWeek (   self)

Get the average number of hours worked each week by this team.

Returns
average hours worked per week

◆ getDayInRotation()

int team.Team.getDayInRotation (   self,
date  day 
)

Get the day number in the rotation for this date.

Parameters
daydate
Returns
day number in the rotation, starting at 1

◆ getPercentageWorked()

float team.Team.getPercentageWorked (   self)

Get the shift rotation's working time as a percentage of the rotation duration.

Returns
Percentage worked

◆ getRotationDuration()

timedelta team.Team.getRotationDuration (   self)

Get the duration of the shift rotation.

Returns
Duration as timedelta

◆ getShiftInstanceForDay()

ShiftInstance team.Team.getShiftInstanceForDay (   self,
date  day 
)

Get the ShiftInstance for the specified day.

Parameters
daydate with a shift instance
Returns
ShiftInstance

◆ isDayOff()

bool team.Team.isDayOff (   self,
date  day 
)

Check to see if this day is a day off.

Parameters
daydate to check
Returns
True if a day off

The documentation for this class was generated from the following file: