Assign students to classes based on preference.
Project description
course_assigner
Overview
course_assigner is a Python library for assigning students to courses based on a preference list. The documentation below should help you understand the parameters passed to the course_assigner functions and what they return, but I recommend starting with examples. Check out the examples in the samples folder
Installation instructions
python3 -m pip install --upgrade pip
python3 -m pip install course_assigner
Classes
The course_assigner library has one method:
assign
: assigns
assign
import course_assigner.assign
from course_assigner import assign
request syntax
assigned_courses = assign(
courses = {
course1: {
"min": course 1 min,
"max": course 1 max
},
course2: {
"min": course 2 min,
"max": course 2 max
},
...
courseN: {
"min": course N min,
"max": course N max
}
},
preferences = {
student_key1: [
student 1 most wanted course,
student 1 second most wanted course,
...
student 1 least wanted course
],
student_key2: [
student 2 most wanted course,
student 2 second most wanted course,
...
student 2 least wanted course
],
...
student_keyN: [
student N most wanted course,
student N second most wanted course,
...
student N least wanted course
],
}
)
parameters
courses
(dict): A dictionary which shows all of the courses which the student can sign up for. The key in each pair is the name of the course. The value has an additional dictionairy with keys "min" and "max". The value for key "min" is the minimum number of people that can sign up for the course, and the value for key "max" is the maximum number of people that can sign up for the course. If there are no minimums or maximums, the value of "min" should be 0 and the value of "max" should be the total number of students.preferences
(dict): A dictionary value which lists the preferences for each student. The key in each pair is the name or identifier for the student. The value is a list of student preferences in which the entry at index 0 is the most preferred course and the entry at index n-1 (for a list of length n) is the least preferred course.
response syntax
{
"student_key1":student 1 assigned course,
"student_key2":student 2 assigned course,
...
"student_keyN":student N assigned course
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
course_assigner-0.0.2.tar.gz
(3.0 kB
view details)
File details
Details for the file course_assigner-0.0.2.tar.gz
.
File metadata
- Download URL: course_assigner-0.0.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95d415c70b563193c9ae968b52c6102f110e70789e771fe7f819fd430fdbdfa2 |
|
MD5 | f01b457202734b6f5a940cd10b158546 |
|
BLAKE2b-256 | e2d05b47475c0004fdb19a498fdec31d64f47c64d7377236d3e0c689c5731f1f |