Baltor Get started

Library / Code module

Shift roster builder with skills, hours and rest limits

shift_roster_builder

Assign staff to shifts while respecting required skills, unavailable dates, overlapping shifts, minimum rest, weekly hour limits and shift count limits, and explain every unfilled position.

Files, names only

  • ATTRIBUTION.md 4.8 KB
  • LICENSE 1.0 KB
  • ONET-ATTRIBUTION.md 5.5 KB
  • PROCEDURE.md 3.0 KB
  • README.md 4.4 KB
  • TOOLS.md 2.1 KB
  • component.json 11.7 KB
  • examples/known_good.json 2.0 KB
  • examples/known_wrong.json 423 bytes
  • kit_schema.py 11.4 KB
  • shift_roster_builder.py 9.0 KB
  • test_package.py 6.8 KB

Full files in your harness.

What it takes and gives

Runs with
Python 3.10 or later
Command
python3 shift_roster_builder.py < input.json
Function
shift_roster_builder.run
Required input
shifts, staff

Cases it covers

  • Known wrong example: Two staff records share the id A, so assignments could not be told apart. Refused as duplicate id.
  • input invalid: refused with exit code 2
  • input not json: refused with exit code 2
  • duplicate id: refused with exit code 2
  • invalid date or time: refused with exit code 2
  • shift too long: refused with exit code 2

Limits and scope

Limits
Greedy, not optimal: an early assignment can make a later shift impossible that another assignment would have filled. Labour law, union rules, pay rates, preferences and requests for days off beyond unavailable dates are not modelled. Rest is checked between assigned shifts only, not against shifts worked before the roster period.
Work activities
Assign duties or work schedules to employees; Prepare employee work schedules; Prepare staff schedules or work assignments.

Details

Kind
Code module
Licence
MIT
Declared effects
runs commands
Source
github.com/alisonjieli-png/loop-engine/tools/creative_originals/occupation_task_kits/items/shift_roster_builder
Size
12 files, 62.1 KB
Identity
library.supply.creative_originals.63b985a57d6d26dc99fd94b4.966c71a58c2ecf74
Version
966c71a58c2ecf74e9c15aa5eb124c68a7afc82f4575bc25b9601647eadd4c74

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Where it is shown

Related components

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.