Command-line implementation of TOPSIS decision making method
Project description
TOPSIS Python Package
This project is a Python command-line tool that implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method.
TOPSIS is a multi-criteria decision making technique used to rank different alternatives based on their distance from an ideal best solution and an ideal worst solution.
This package allows users to apply the TOPSIS method easily using a single command from the terminal.
Installation
The package can be installed using pip.
pip install Topsis-KhushiMehta-102303769
Usage
After installing the package, the TOPSIS method can be executed from the command line using the following format:
topsis <input_file> <output_file>
Example:
topsis data.csv "1,1,1" "+,+,+" result.csv
Here,
input_file : CSV or Excel (.xlsx) file containing the data
weights : Comma-separated numerical values indicating importance of criteria
impacts : Comma-separated symbols (+ or -) indicating benefit or cost criteria
output_file : CSV file where the result will be stored
Input File Format
The input file must be provided in CSV or Excel (.xlsx) format.
The first column of the file should contain the names of the alternatives. All remaining columns must contain numeric values only.
Sample Input Table:
Alternative | C1 | C2 | C3 A1 | 250 | 16 | 12 A2 | 200 | 20 | 8 A3 | 300 | 14 | 16
Weights and Impacts
Weights represent the importance of each criterion. They must be provided as comma-separated numeric values.
Example: "1,1,1"
Impacts specify whether a criterion is beneficial or non-beneficial. Use '+' for benefit criteria and '-' for cost criteria.
Example: "+,+,-"
The number of weights and impacts must be equal to the number of criteria columns in the input file.
Output File
The output is generated in CSV format.
Two additional columns are added to the original data: Topsis Score Rank
A higher Topsis Score indicates a better alternative. The alternative with the highest score is assigned rank 1.
Error Handling
The program performs the following validations before processing the data:
Correct number of command-line arguments
Input file existence
Minimum of three columns in the input file
Numeric values in criteria columns
Matching number of weights, impacts, and criteria columns
Valid impact values (+ or -)
Appropriate error messages are displayed if any of the above conditions fail.
About TOPSIS
TOPSIS ranks alternatives based on their relative closeness to the ideal solution. The alternative closest to the ideal best solution and farthest from the ideal worst solution is considered the best option.
Author
Khushi Mehta
Developed as part of an academic assignment
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topsis_khushimehta_102303769-1.0.1.tar.gz.
File metadata
- Download URL: topsis_khushimehta_102303769-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43910f463ab71135aa09667149883e92f600ba882caec541723db9e86cdb4bc3
|
|
| MD5 |
6700bc60c73d0aa39f54d680d1607bce
|
|
| BLAKE2b-256 |
6c286f1069c89cb418e6e1c49b4fd6ccbe91696a050e78fc2773105821889eb8
|
File details
Details for the file topsis_khushimehta_102303769-1.0.1-py3-none-any.whl.
File metadata
- Download URL: topsis_khushimehta_102303769-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10b506065eba983da832fcd5132d8f883a3fa60641f144af57f98b52162a5bee
|
|
| MD5 |
e5bccd597923fc4aaa1514da175ce1da
|
|
| BLAKE2b-256 |
8808d95558c16c59a8d4874902af7748112ae70b53311e4b6c0f325cc38258ad
|