A Python package implementing TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) for multi-criteria decision making.
Project description
Topsis-Sameer-102316089
A Python package that implements TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) — a multi-criteria decision-making method.
Installation
pip install Topsis-Sameer-102316089
Usage
Run from the command line:
topsis <InputDataFile> <Weights> <Impacts> <OutputResultFileName>
Example
topsis data.csv "1,1,1,2" "+,+,-,+" output.csv
Parameters
| Parameter | Description |
|---|---|
InputDataFile |
Path to input CSV/Excel file |
Weights |
Comma-separated weights (e.g., "1,1,1,2") |
Impacts |
Comma-separated impacts, + or - (e.g., "+,+,-,+") |
OutputResultFileName |
Path for the output CSV file |
Input File Format
- The input file must contain three or more columns.
- The first column is the name/label of each alternative (e.g., M1, M2, …).
- Column 2 onwards must contain numeric values only.
Sample Input (data.csv)
| Fund Name | P1 | P2 | P3 | P4 | P5 |
|---|---|---|---|---|---|
| M1 | 0.67 | 0.45 | 6.5 | 42.6 | 12.56 |
| M2 | 0.60 | 0.36 | 3.6 | 53.3 | 14.47 |
| M3 | 0.82 | 0.67 | 3.8 | 63.1 | 17.10 |
Output File Format
The output file contains all original columns plus two new columns:
| Column | Description |
|---|---|
Topsis Score |
The computed TOPSIS score (0 to 1) |
Rank |
Rank based on score (1 = best) |
Sample Output (output.csv)
| Fund Name | P1 | P2 | P3 | P4 | P5 | Topsis Score | Rank |
|---|---|---|---|---|---|---|---|
| M1 | 0.67 | 0.45 | 6.5 | 42.6 | 12.56 | 20.58 | 2 |
| M2 | 0.60 | 0.36 | 3.6 | 53.3 | 14.47 | 40.83 | 4 |
| M3 | 0.82 | 0.67 | 3.8 | 63.1 | 17.10 | 30.07 | 3 |
Input Validations
The program checks for the following:
- Correct number of parameters — exactly 4 arguments required
- File not found — shows an appropriate error message
- Minimum columns — input file must have ≥ 3 columns
- Numeric values — columns 2 onwards must be numeric
- Count match — number of weights, impacts, and criteria columns must be equal
- Valid impacts — impacts must be
+or-only - Comma-separated — weights and impacts must be separated by commas
License
MIT © Sameer
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_sameer_102316089-1.0.3.tar.gz.
File metadata
- Download URL: topsis_sameer_102316089-1.0.3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
615ed6e12d92dcdcac8b795ee1f61813b9df16323cdaebd42f31839b7274277d
|
|
| MD5 |
e022de0fda229ee2b5a89b3e2c564a7b
|
|
| BLAKE2b-256 |
c7ff141de9d444a01d77c6b20a9a5aeda6744510537c9a1156af5cb584335f28
|
File details
Details for the file topsis_sameer_102316089-1.0.3-py3-none-any.whl.
File metadata
- Download URL: topsis_sameer_102316089-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda72d2abb1cdc7020c282fcae4e5a4f8930cd9b8dcd715465a50f3c8b115d28
|
|
| MD5 |
746327a8898f1069fcdfd86ad5647f68
|
|
| BLAKE2b-256 |
fa21322f4beead369feed1166412310d136c61e7ee747069cb7b3f9328799263
|