Skip to main content

A series of classes to match mentors and mentees

Project description

Mentor Match

This is a package to help match mentees and mentors.

It uses this implementation of Munkres to find the most effective pairings. The Munkres algorithm works on a grid of scores.

Scoring

Full details of how the matches are calculated can be read in the code itself. Customisable configurations are on the roadmap but are not planned for any upcoming releases.

Installation

You can install this project with python -m pip install mentor-match

Use

To use this library, first install it (see above). You may need to munge your data for the system to be happy with it. Use the example CSV file as guides for your mentor and mentee data, then put them together in the same folder.

The software will run as many matching exercises as you pass list[AbstractRule]. So you'll need to come up with some rules as to how you want your mentors and mentees to be matched. For more information on rules, see Rules.

Here is a snippet that outlines a minimal use in a Python project:

from matching import process
from pathlib import Path
from matching.rules.rule import Generic

data_folder = Path("Documents/mentoring-data")
mentors, mentees = process.conduct_matching_from_file(
    path_to_data=data_folder,
    rules=[[Generic({True: 3, False: 0}, lambda match: match.mentee.organisation != match.mentor.organisation)]]
)

output_folder = data_folder / "output"
process.create_mailing_list(mentors, output_folder)
process.create_mailing_list(mentees, output_folder)

This weights matches where mentors and mentees are in different organisations. For more on rules, see Rules. The system then creates a mailing list according to a set template, ready for processing by your favourite/enterprise mandated email solution

Rules

All rules are subclassed from the AbstractRule class. They need an evaluate method, which should take a Match object and return a boolean, and an apply method, which takes a Match object, evaluates it, and changes the internal state of the Match object.

I've included a couple of pre-defined rules to help start you off:

Grade

Grade needs a target difference in grades between mentors and mentees, an operator to compare them, and a score to give if the operation is true or if it's false. So Grade(2, operator.gt, {True: 3, False: 0}) will create a rule that gives 3 points to a grade difference between the mentor and the mentee that's greater than 2.

UnmatchedBonus

UnmatchedBonus only needs an integer value to add to the Match score. It'll add it if either the mentor or the mentee doesn't have any connections. This is helpful if you run multiple rounds, as it'll give the edge to mentors/mentees who haven't been successfully matched yet.

Disqualify

Disqualify needs to be passed a function that takes a Match object and returns a bool. It's an anti-rule: if the condition evaluates to True, then that Match is disqualified for this round. Two Disqualify rules are pre-defined on the Match object - a Match is disqualified if both Mentor and Mentee are the same person, or if they've already been matched once.

Generic

Generic, like Disqualify, takes a function with the signature [[Match], bool]. It also takes a dictionary, like Grade, where you define what score to be given to the Match if the function evaluates to true, or indeed if it evaluates to false!

Export

There's an inbuilt ExportToSpreadsheet which very much does what it says on the tin. Instantiate it with a list of Person objects and where you want the output to end up and call export to do the thing.

You can also subclass ExportToEmail for all your email-exporting needs. Or write your own thing entirely!

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

mentor-match-7.0.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mentor_match-7.0.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file mentor-match-7.0.1.tar.gz.

File metadata

  • Download URL: mentor-match-7.0.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mentor-match-7.0.1.tar.gz
Algorithm Hash digest
SHA256 cfb62cc6c9bc9fba54d4d1dff55d2b26e43b8106640ef21cab6ee86e814ad3bf
MD5 559de83af01f8c12834ba520ebeb21b9
BLAKE2b-256 32adeddcd8b892cf28ef896a7e8b8bd624c0cf09da2ae2188d65de7b04eb7ef9

See more details on using hashes here.

File details

Details for the file mentor_match-7.0.1-py3-none-any.whl.

File metadata

  • Download URL: mentor_match-7.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mentor_match-7.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b1c667a7331eba18342d7690ac197501816bcb8f4b0c8da76987930c96147b9
MD5 4cb270cd157c77894cd30a6e1deeed91
BLAKE2b-256 6a11340f84e8d690cf39c9b0f1d6193b4ec2296a56a4f3344d65697e8f433653

See more details on using hashes here.

Supported by

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