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.
ATTRIBUTION.md4.8 KBLICENSE1.0 KBONET-ATTRIBUTION.md5.5 KBPROCEDURE.md3.0 KBREADME.md4.4 KBTOOLS.md2.1 KBcomponent.json11.7 KBexamples/known_good.json2.0 KBexamples/known_wrong.json423 byteskit_schema.py11.4 KBshift_roster_builder.py9.0 KBtest_package.py6.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
- Records, schedules and budgetsDeterministic skills
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.