Skip to main content

pypam3 - Project Assignment Method

Pypam3 is a small tool to assign students(workers) to projects(jobs) based on their rank of preference(cost) to each of the projects(jobs).

module

Currently, there is only one module named assign in this package

assign

Two functions, assign_project() and generate_sample(), realize the facility.

assign_project(csv_name, capacity, **kwargs)

This function is for assigning. To use this function, you need to put a .csv file on the same directory whose rows represent students and columns represents projects. The numbers represent the rank of preference that students evaluate. No title should be included. for example:

5, 4, 2, 1, 3
4, 3, 2, 1, 5
3, 2, 1, 5, 4

To convert an Excel file to .csv file, you can easily use Microsoft Excel and press File-Save File as-.csv

The name of the csv file is the first argument.

The second argument is the number of students that a project can take at most.

This function also take several optional key-word arguments:

  • output: This argument has two options, "file" or "stdout". The "file" value will ask the program to

output the result by creating a new file result.xlsx, the Sheet1 of the Excel file show the project that each student is assigned to, and the Sheet2 shows which students are assigned to each project. The "stdout" option is the default option. It will directly output the result to the terminal.

  • deviation: If set to True(default), the program will also output the standard deviation to the terminal. If set to False, it will not be calculated.

  • time: If set to True(default), the program will also print the runtime of the function to the terminal. Otherwise, no.

Example of using:

from pypam3.assign import assign_project
assign_project("data.csv", 5, output="file")

generate_sample(csv_name, student_num, project_num)

This function can randomly generate samples, and it's mainly for testing purpose.

Example of using:

from pypam3.assign import generate_sample
generate_sample("data.csv", 80, 20)

This will create a csv file named "data.csv" at the current directory with 80 rows and 20 columns.

Using

First install python3 from https://www.python.org. Note that the package should be added to PATH. To download this package, type in the terminal: linux/mac:

pip3 install pypam3
pip3 install openpyxl
pip3 install munkres

windows:

pip install pypam3
pip install openpyxl
pip install munkres

And add these lines at the beginning of your python script:

from pypam3.assign import generate_sample, assign_project
from munkres import Munkres
import openpyxl

Then you can use this package as stated above.

Release files for pypam3 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypam3 0.1.2
File Size Uploaded
pypam3-0.1.2.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypam3 0.1.2
File Interpreter ABI Platform
pypam3-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / pypam3-0.1.2.tar.gz

Download URL pypam3-0.1.2.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4c01be166db974c00384173875d94fff8abe855d1c05da3601bf93d5fe0d97cb
BLAKE2b-256 checksum
How to use checksums
d58aae0e1aa5eee547f7a0dee15e794188917f1109398356f573cbb1e8ee2334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

Release files / pypam3-0.1.2-py3-none-any.whl

Download URL pypam3-0.1.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e3d0dcd40c4ec95314ea89ca0fb3843942fba0abf9b698db2efe5129b7324bb
BLAKE2b-256 checksum
How to use checksums
152a9eff54dbb4e2b29ab48207832b6488110ef1d580465278fde0e021760001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page