|
PyShift Work Schedule
Work Schedule for Python
|
Class WorkSchedule represents a named group of teams who collectively work one or more shifts with off-shift periods. More...
Public Member Functions | |
| __init__ (self, str name, str description) | |
| Construct a work schedule. | |
| deleteTeam (self, Team team) | |
| Remove this team from the schedule. | |
| deleteNonWorkingPeriod (self, NonWorkingPeriod period) | |
| Remove a non-working period from the schedule. | |
| [] | getShiftInstancesForDay (self, date day) |
| Get the list of shift instances for the specified date that start during that date. | |
| [] | getShiftInstancesForTime (self, datetime dateTime) |
| Get the list of shift instances for the specified date and time of day. | |
| Team | createTeam (self, str name, str description, Rotation rotation, time rotationStart) |
| Create a team. | |
| Shift | createShift (self, str name, str description, time start, timedelta duration) |
| Create a shift. | |
| deleteShift (self, Shift shift) | |
| Delete this shift. | |
| NonWorkingPeriod | createNonWorkingPeriod (self, str name, str description, datetime startDateTime, timedelta duration) |
| Create a non-working period of time. | |
| Rotation | createRotation (self, str name, str description) |
| Create a rotation. | |
| timedelta | getRotationDuration (self) |
| Get total duration of rotations across all teams. | |
| timedelta | getRotationWorkingTime (self) |
| Get the total working time for all team rotations. | |
| timedelta | calculateWorkingTime (self, datetime fromTime, datetime toTime) |
| Calculate the scheduled working time between the specified dates and times of day. | |
| timedelta | calculateNonWorkingTime (self, datetime fromTime, datetime toTime) |
| Calculate the non-working time between the specified dates and times of day. | |
| printShiftInstances (self, date start, date end) | |
| Print shift instances. | |
| str | __str__ (self) |
Static Public Member Functions | |
| datetime | getPeriodKey (NonWorkingPeriod period) |
| Get the key for sorting non-working periods | |
Public Attributes | |
| teams | |
| shifts | |
| rotations | |
| nonWorkingPeriods | |
Static Public Attributes | |
| key | |
Class WorkSchedule represents a named group of teams who collectively work one or more shifts with off-shift periods.
A work schedule can have periods of non-working time as well as breaks.
| work_schedule.WorkSchedule.__init__ | ( | self, | |
| str | name, | ||
| str | description ) |
Construct a work schedule.
| name | Schedule name |
| description | Schedule description |
| timedelta work_schedule.WorkSchedule.calculateNonWorkingTime | ( | self, | |
| datetime | fromTime, | ||
| datetime | toTime ) |
Calculate the non-working time between the specified dates and times of day.
| fromTime | Starting date and time of day |
| toTime | Ending date and time of day |
| timedelta work_schedule.WorkSchedule.calculateWorkingTime | ( | self, | |
| datetime | fromTime, | ||
| datetime | toTime ) |
Calculate the scheduled working time between the specified dates and times of day.
Non-working periods are removed.
| fromTime | Starting date and time of day |
| toTime | Ending date and time of day |
| NonWorkingPeriod work_schedule.WorkSchedule.createNonWorkingPeriod | ( | self, | |
| str | name, | ||
| str | description, | ||
| datetime | startDateTime, | ||
| timedelta | duration ) |
Create a non-working period of time.
| name | Name of period |
| description | Description of period |
| startDateTime | Starting date and time of day |
| duration | Duration of period |
NonWorkingPeriod | Rotation work_schedule.WorkSchedule.createRotation | ( | self, | |
| str | name, | ||
| str | description ) |
Create a rotation.
| name | Name of rotation |
| description | Description of rotation |
Rotation | Shift work_schedule.WorkSchedule.createShift | ( | self, | |
| str | name, | ||
| str | description, | ||
| time | start, | ||
| timedelta | duration ) |
Create a shift.
| name | Name of shift |
| description | Description of shift |
| start | start time of day |
| duration | duration of shift |
Shift | Team work_schedule.WorkSchedule.createTeam | ( | self, | |
| str | name, | ||
| str | description, | ||
| Rotation | rotation, | ||
| time | rotationStart ) |
Create a team.
| name | Name of team |
| description | description of team |
| rotation | rotation |
| rotationStart | Start of rotation |
Team | work_schedule.WorkSchedule.deleteNonWorkingPeriod | ( | self, | |
| NonWorkingPeriod | period ) |
Remove a non-working period from the schedule.
| period | NonWorkingPeriod |
| work_schedule.WorkSchedule.deleteShift | ( | self, | |
| Shift | shift ) |
Delete this shift.
| shift | Shift to delete |
| work_schedule.WorkSchedule.deleteTeam | ( | self, | |
| Team | team ) |
Remove this team from the schedule.
| team | Team |
|
static |
| timedelta work_schedule.WorkSchedule.getRotationDuration | ( | self | ) |
Get total duration of rotations across all teams.
| timedelta work_schedule.WorkSchedule.getRotationWorkingTime | ( | self | ) |
Get the total working time for all team rotations.
| [] work_schedule.WorkSchedule.getShiftInstancesForDay | ( | self, | |
| date | day ) |
Get the list of shift instances for the specified date that start during that date.
| day | date |
ShiftInstance | [] work_schedule.WorkSchedule.getShiftInstancesForTime | ( | self, | |
| datetime | dateTime ) |
Get the list of shift instances for the specified date and time of day.
| dateTime | Date and time of day |
ShiftInstance | work_schedule.WorkSchedule.printShiftInstances | ( | self, | |
| date | start, | ||
| date | end ) |
Print shift instances.
| start | Starting date |
| end | Ending date |