Using python to assist in creathing a training assessment schedule?

Hi all, completely new to python with limited coding experience.

In my job as a training coordinator, I am looking for a solution to assist me in developing a training assessment schedule with various “rules” to assist. I generally have to do this once or twice a month.

At this stage, just looking to see if this may be possible with python (or another coding platform). If it is possible, I’ll look to develop it as a long-term goal over the next 12 months or so. If not, then I’ll just keep on creating the schedule manually!

General Information

Timeslots – 0800, 1000, 1230 & 1430.

Dates – for example: 1, 2 & 3 July 2025.

Assessors – Sam, Tim and Wade.

Assessments – CR, CV, DG, FL, BA, CS & CC.

Rules

CR, CV and/or DG can be done in the same timeslot (with Sam – max 3 participants per timeslot).

FL can only be done by itself in a timeslot (with Tim – max 3 participants per timeslot).

BA, CS and/or CC can be done in the same timeslot (with Wade – max 5 participants per timeslot).

Participants may have only 1 or all of the assessments to complete. Would be approx. 30 participants for a 3 day schedule.

Input data to be from an Excel table, for example:

Home Location, Name, Assessment

LA, Chris Test, DG

LA, Chris Test, CV

LA, Chris Test, BA

LA, Chris Test, CS

LA, Chris Test, FY

NY, Nicole Trial, DG

NY, Nicole Trial, CR

NY, Nicole Trial, BA

NY, Nicole Trial, CC

LA, James Hello, DG

LA, James Hello, FL

NY, Debra Earth, BA

Output to be:

Date, Time, Assessor, Location, Name, Assessment

01/07/2025, 08:00, Sam, LA, Chris Test, DG

01/07/2025, 10:00, Wade, LA, Chris Test, BA

And so on with a seperate row for each participant/assessment.

Goal

The goal would be for the script to create a schedule using the rules so that there are no conflicts. The data would then be used to further create the schedule for participants and assessors.

Again, just looking to see if something like this may be possible at this stage! Thanks.

Just to make sure I’m understand you: it sounds like you’re saying you have a file that gives some information about conditions that must be met (like “Chris Test must do a DG assessment”) and then you have some constraints (like “FL cannot share a timeslot with any other assessment”) and you want to create a schedule subject to those constraints.

It’s certainly possible to write some Python to implement such logic. In theory, many complications can arise; for instance it can be the case that the constraints are unsatisfiable (e.g., if there are 10,000 participants there won’t be any way to do them all in three days), or that finding a solution takes an extremely long time. However, if the constraints are as simple as you describe here, you can probably get a pretty good solution with a simple implementation that just gives up with an error if it encounters anything too pathological.

It’s also important to make sure you can explicitly state all necessary constraints. For instance, your example data mentions locations and times, and doesn’t mention constraints on them, but do such constraints exist? For instance, can Sam give an assessment at 0800 for a participant in LA and then another at 1000 the same day for another participant in NY? And if so, are those 0800 and 1000 times in the LA timezone or the NY timezone?

Once you’ve got all that kind of thing clear, if you are just starting out with Python, my advice would be to begin by trying to implement something that builds the schedule using simple heuristics. For instance, since FL has to be done by itself, you could just start by finding everyone who needs that assessment and scheduling all those first, using as many timeslots as necessary. Then find everyone who needs the CR/CV/DG assessments and schedule all those next, and so on. In doing this you may discover that there are other “hidden” constraints you hadn’t thought of, but you can iterate, improving your algorithm as necessary to handle such cases.

How you actually implement that with Python is another matter, but it seems like at this stage you’re working more at the conceptual level. If you know how to use basic Python types like lists and dictionaries you can take a stab at figuring out how to use those to represent your data, and ask for help (here or elsewhere) as you have more specific questions.

sounds like a job for google’s OR-tools Assignment  |  OR-Tools  |  Google for Developers

It is called “linear programming”. There are paid and free tools which can solve it, you can use many of them through google’s OR-tools. But, frankly, you might not need python for it: you may find easier writing out .lp (linear programming) files and solving them.