Skip to main content

No project description provided

Project description

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.

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

pypam3-0.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pypam3-0.1.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pypam3-0.1.2.tar.gz.

File metadata

  • Download URL: pypam3-0.1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pypam3-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4c01be166db974c00384173875d94fff8abe855d1c05da3601bf93d5fe0d97cb
MD5 58dc101a614395268b81ef09c5a071b8
BLAKE2b-256 d58aae0e1aa5eee547f7a0dee15e794188917f1109398356f573cbb1e8ee2334

See more details on using hashes here.

File details

Details for the file pypam3-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pypam3-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pypam3-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e3d0dcd40c4ec95314ea89ca0fb3843942fba0abf9b698db2efe5129b7324bb
MD5 00f99482d3260df7cf8e10a051d24cee
BLAKE2b-256 152a9eff54dbb4e2b29ab48207832b6488110ef1d580465278fde0e021760001

See more details on using hashes here.

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