TOPSIS implementation as a Python package
Project description
Topsis-Vani-102303064
This package implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method. TOPSIS is a multi-criteria decision-making technique used to rank alternatives based on their distance from an ideal best and ideal worst solution.
Installation
Install the package from PyPI using pip:
pip install topsis-vani-102303064
Usage (Command Line)
After installation, the package can be used directly from the command line.
Syntax
bash
Copy code
topsis <InputDataFile> <Weights> <Impacts> <OutputResultFileName>
Example
bash
Copy code
topsis data.csv "1,1,1,2" "+,+,-,+" output.csv
Input File Format
The input file must be a CSV or XLSX file.
The file must contain at least three columns.
First column: Alternative names (non-numeric).
From second column onwards: Numeric criteria values only.
Example Input (data.csv)
csv
Copy code
Fund Name,P1,P2,P3,P4
M1,0.67,0.45,6.5,42.6
M2,0.60,0.36,3.6,53.3
M3,0.82,0.67,3.8,63.1
Weights and Impacts
Weights must be numeric values separated by commas.
Example:
text
Copy code
1,1,1,2
Impacts must be either + or -, separated by commas.
Example:
text
Copy code
+,+,-,+
The number of weights and impacts must match the number of criteria columns.
Output File
The output file is generated in CSV format.
Two additional columns are added:
Topsis Score
Rank (Rank 1 indicates the best alternative)
Example Output Columns
text
Copy code
Fund Name,P1,P2,P3,P4,Topsis Score,Rank
Error Handling
The program performs validation checks for:
Correct number of command-line arguments
Input file existence
Minimum number of columns
Numeric values in criteria columns
Correct number of weights and impacts
Valid impact symbols (+ or -)
Appropriate error messages are displayed for invalid inputs.
License
This project is licensed under the MIT License.
Author
Vani
Roll Number: 102303064
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
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_vani_102303064-1.0.0.tar.gz.
File metadata
- Download URL: topsis_vani_102303064-1.0.0.tar.gz
- Upload date:
- Size: 4.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 |
4d0963399878f2424db9580dc4fffdbfaec276accde44428e6c28cbc0b1de60e
|
|
| MD5 |
4262307b58af0632f6490ac7bdb7bcb2
|
|
| BLAKE2b-256 |
41862b1a95c99479d22404ce0ca6e7d9b1657a98d18f296ad6a447f180835974
|
File details
Details for the file topsis_vani_102303064-1.0.0-py3-none-any.whl.
File metadata
- Download URL: topsis_vani_102303064-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 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 |
b33bbb3b7225e4d3520b55495bd938c38436f2052efd30489063bb13667134d6
|
|
| MD5 |
2ab05f87b35a79a3bafaded8cadc4af6
|
|
| BLAKE2b-256 |
3809918b22f65cd4c93cb21a5d75be8c31c466a0a18468f4bf23b04c6e388e4e
|