|
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 | |
| def | __init__ (self, str name, str description) |
| Construct a work schedule. More... | |
| def | deleteTeam (self, Team team) |
| Remove this team from the schedule. More... | |
| def | deleteNonWorkingPeriod (self, NonWorkingPeriod period) |
| Remove a non-working period from the schedule. More... | |
| [ShiftInstance] | getShiftInstancesForDay (self, date day) |
| Get the list of shift instances for the specified date that start during that date. More... | |
| [ShiftInstance] | getShiftInstancesForTime (self, datetime dateTime) |
| Get the list of shift instances for the specified date and time of day. More... | |
| Team | createTeam (self, str name, str description, Rotation rotation, time rotationStart) |
| Create a team. More... | |
| Shift | createShift (self, str name, str description, time start, timedelta duration) |
| Create a shift. More... | |
| def | deleteShift (self, Shift shift) |
| Delete this shift. More... | |
| NonWorkingPeriod | createNonWorkingPeriod (self, str name, str description, datetime startDateTime, timedelta duration) |
| Create a non-working period of time. More... | |
| Rotation | createRotation (self, str name, str description) |
| Create a rotation. More... | |
| timedelta | getRotationDuration (self) |
| Get total duration of rotations across all teams. More... | |
| timedelta | getRotationWorkingTime (self) |
| Get the total working time for all team rotations. More... | |
| timedelta | calculateWorkingTime (self, datetime fromTime, datetime toTime) |
| Calculate the scheduled working time between the specified dates and times of day. More... | |
| timedelta | calculateNonWorkingTime (self, datetime fromTime, datetime toTime) |
| Calculate the non-working time between the specified dates and times of day. More... | |
| def | printShiftInstances (self, date start, date end) |
| Print shift instances. More... | |
| str | __str__ (self) |
Static Public Member Functions | |
| time | getPeriodKey (NonWorkingPeriod period) |
| Get the key for sorting non-working periods More... | |
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.
| def 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 |
| Rotation work_schedule.WorkSchedule.createRotation | ( | self, | |
| str | name, | ||
| str | description | ||
| ) |
Create a rotation.
| name | Name of rotation |
| description | Description of 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 |
| 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 |
| def work_schedule.WorkSchedule.deleteNonWorkingPeriod | ( | self, | |
| NonWorkingPeriod | period | ||
| ) |
Remove a non-working period from the schedule.
| period | NonWorkingPeriod |
| def work_schedule.WorkSchedule.deleteShift | ( | self, | |
| Shift | shift | ||
| ) |
Delete this shift.
| shift | Shift to delete |
| def 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.
| [ShiftInstance] 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 |
| def work_schedule.WorkSchedule.printShiftInstances | ( | self, | |
| date | start, | ||
| date | end | ||
| ) |
Print shift instances.
| start | Starting date |
| end | Ending date |