Skip to main content

Assign students to classes based on preference.

Project description

course_assigner

License: MIT

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


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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page