# Topsis-Vivek-102203871
This Python package implements the **TOPSIS** (Technique for Order of Preference by Similarity to Ideal Solution) decision-making method. It helps evaluate and rank alternatives based on multiple criteria, supporting both **CSV** and **Excel** file formats.
## Features
- Simple command-line interface.
- Supports both `.csv` and `.xlsx` input formats.
- Allows specifying weights and impacts for decision criteria.
- Outputs the Topsis score and rank for each alternative.
## Installation
To install the package, use `pip` (Python package manager). Run the following command in your terminal:
```bash
pip install Topsis-Vivek-102203871
```
## STEPS
Step 1: Prepare Your Input Data
The input file should have at least 3 columns:
The first column should represent the alternatives/objects (e.g., M1, M2, M3, etc.).
The second column and beyond should contain numeric values representing the criteria for each alternative.
Example Input Data (CSV format)
Fund Name, P1, P2, P3, P4, P5
M1, 0.84, 0.71, 6.7, 42.1, 12.59
M2, 0.91, 0.83, 7.0, 31.7, 10.11
M3, 0.79, 0.62, 4.8, 46.7, 13.23
M4, 0.78, 0.61, 6.4, 42.4, 12.55
M5, 0.94, 0.88, 3.6, 62.2, 16.91
Example Input Data (Excel format)
Alternatively, you can provide the data in Excel (.xlsx) format.
Step 2: Define Weights and Impacts
Weights: The relative importance of each criterion (must be comma-separated).
Impacts: The direction of preference for each criterion (+ for benefit, - for cost).
Example Weights and Impacts
Weights: "0.25, 0.25, 0.25, 0.25"
Impacts: "+,+,-,+"
Step 3: Running the Command
Once your input data is ready, you can run the package using the command line. The format is:
```bash
python -m Topsis_Vivek_102203871 <input_file> <weights> <impacts> <result_file>
```
Example Command
```bash
python -m Topsis_Vivek_102203871 102203871-data.xlsx "0.25, 0.25, 0.25, 0.25" "+,+,-,+" 102203871-result.csv
```
Where:
102203871-data.xlsx is the input file (can be .csv or .xlsx).
"0.25, 0.25, 0.25, 0.25" represents the weights of each criterion.
"+,+,-,+" represents the impacts of each criterion.
102203871-result.csv is the output file where results will be saved.
Step 4: Understanding the Output
The output file will contain:
The original data.
Two additional columns:
Topsis Score: The computed score for each alternative.
Rank: The rank based on the Topsis score (lower score = better rank).
Example Output (CSV):
Fund Name, P1, P2, P3, P4, P5, Topsis Score, Rank
M1, 0.84, 0.71, 6.7, 42.1, 12.59, 0.865, 2
M2, 0.91, 0.83, 7.0, 31.7, 10.11, 0.799, 3
M3, 0.79, 0.62, 4.8, 46.7, 13.23, 0.935, 1
M4, 0.78, 0.61, 6.4, 42.4, 12.55, 0.876, 4
M5, 0.94, 0.88, 3.6, 62.2, 16.91, 0.980, 5
The Topsis Score column represents how close each alternative is to the ideal solution, and the Rank column indicates the rank based on the Topsis score.
## How it works
How the Package Works
Normalization: The decision matrix is normalized using vector normalization.
Weighted Matrix: The normalized matrix is weighted according to the user-defined weights.
Ideal Solutions: The positive and negative ideal solutions are determined based on the direction of the impacts.
Topsis Score: The Topsis score is calculated using the distance between the alternatives and the ideal solutions.
Rank: The alternatives are ranked based on the calculated Topsis score.
Error Handling
The package performs the following validations:
File Not Found: Checks if the input file exists.
Correct Number of Parameters: Ensures that the number of command-line arguments is correct.
Valid Weights: Ensures that the weights are numeric and properly formatted.
Valid Impacts: Ensures that the impacts contain only + or -.
Valid Input Data: Ensures that the data columns contain only numeric values (except the first column).
## License
This package is distributed under the MIT License. See LICENSE.txt for more details.
## Contact
For any questions or issues, feel free to contact me at atrivivek001@gmail.com.
### Summary
- This `README.md` provides a full guide on how to install, use, and understand the **Topsis-Vivek-102203871** package.
- It includes clear instructions, example inputs/outputs, and error handling.
Raw data
{
"_id": null,
"home_page": "https://github.com/VivekAttri01/Topsis-Vivek-102203871",
"name": "Topsis-Vivek-102203871",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Vivek",
"author_email": "atrivivek001@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b3/12/a26fa17435134f9fce69a4e2a26f39cfdf2ce9e01251948eea9d2b785f4b/topsis_vivek_102203871-1.0.5.tar.gz",
"platform": null,
"description": "# Topsis-Vivek-102203871\n\nThis Python package implements the **TOPSIS** (Technique for Order of Preference by Similarity to Ideal Solution) decision-making method. It helps evaluate and rank alternatives based on multiple criteria, supporting both **CSV** and **Excel** file formats.\n\n## Features\n\n- Simple command-line interface.\n- Supports both `.csv` and `.xlsx` input formats.\n- Allows specifying weights and impacts for decision criteria.\n- Outputs the Topsis score and rank for each alternative.\n\n## Installation\n\nTo install the package, use `pip` (Python package manager). Run the following command in your terminal:\n\n```bash\npip install Topsis-Vivek-102203871\n```\n\n## STEPS\nStep 1: Prepare Your Input Data\nThe input file should have at least 3 columns:\n\nThe first column should represent the alternatives/objects (e.g., M1, M2, M3, etc.).\nThe second column and beyond should contain numeric values representing the criteria for each alternative.\nExample Input Data (CSV format)\nFund Name, P1, P2, P3, P4, P5\nM1, 0.84, 0.71, 6.7, 42.1, 12.59\nM2, 0.91, 0.83, 7.0, 31.7, 10.11\nM3, 0.79, 0.62, 4.8, 46.7, 13.23\nM4, 0.78, 0.61, 6.4, 42.4, 12.55\nM5, 0.94, 0.88, 3.6, 62.2, 16.91\nExample Input Data (Excel format)\nAlternatively, you can provide the data in Excel (.xlsx) format.\n\nStep 2: Define Weights and Impacts\nWeights: The relative importance of each criterion (must be comma-separated).\nImpacts: The direction of preference for each criterion (+ for benefit, - for cost).\nExample Weights and Impacts\nWeights: \"0.25, 0.25, 0.25, 0.25\"\nImpacts: \"+,+,-,+\"\nStep 3: Running the Command\nOnce your input data is ready, you can run the package using the command line. The format is:\n\n```bash\npython -m Topsis_Vivek_102203871 <input_file> <weights> <impacts> <result_file>\n```\nExample Command\n```bash\npython -m Topsis_Vivek_102203871 102203871-data.xlsx \"0.25, 0.25, 0.25, 0.25\" \"+,+,-,+\" 102203871-result.csv\n```\nWhere:\n\n102203871-data.xlsx is the input file (can be .csv or .xlsx).\n\"0.25, 0.25, 0.25, 0.25\" represents the weights of each criterion.\n\"+,+,-,+\" represents the impacts of each criterion.\n102203871-result.csv is the output file where results will be saved.\nStep 4: Understanding the Output\nThe output file will contain:\n\nThe original data.\nTwo additional columns:\nTopsis Score: The computed score for each alternative.\nRank: The rank based on the Topsis score (lower score = better rank).\nExample Output (CSV):\n\nFund Name, P1, P2, P3, P4, P5, Topsis Score, Rank\nM1, 0.84, 0.71, 6.7, 42.1, 12.59, 0.865, 2\nM2, 0.91, 0.83, 7.0, 31.7, 10.11, 0.799, 3\nM3, 0.79, 0.62, 4.8, 46.7, 13.23, 0.935, 1\nM4, 0.78, 0.61, 6.4, 42.4, 12.55, 0.876, 4\nM5, 0.94, 0.88, 3.6, 62.2, 16.91, 0.980, 5\nThe Topsis Score column represents how close each alternative is to the ideal solution, and the Rank column indicates the rank based on the Topsis score.\n\n## How it works\nHow the Package Works\nNormalization: The decision matrix is normalized using vector normalization.\nWeighted Matrix: The normalized matrix is weighted according to the user-defined weights.\nIdeal Solutions: The positive and negative ideal solutions are determined based on the direction of the impacts.\nTopsis Score: The Topsis score is calculated using the distance between the alternatives and the ideal solutions.\nRank: The alternatives are ranked based on the calculated Topsis score.\nError Handling\nThe package performs the following validations:\n\nFile Not Found: Checks if the input file exists.\nCorrect Number of Parameters: Ensures that the number of command-line arguments is correct.\nValid Weights: Ensures that the weights are numeric and properly formatted.\nValid Impacts: Ensures that the impacts contain only + or -.\nValid Input Data: Ensures that the data columns contain only numeric values (except the first column).\n## License\nThis package is distributed under the MIT License. See LICENSE.txt for more details.\n\n## Contact\nFor any questions or issues, feel free to contact me at atrivivek001@gmail.com.\n\n\n\n### Summary\n\n- This `README.md` provides a full guide on how to install, use, and understand the **Topsis-Vivek-102203871** package.\n- It includes clear instructions, example inputs/outputs, and error handling.\n\n\n\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for implementing the Topsis method",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/VivekAttri01/Topsis-Vivek-102203871"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a69e1fe11ff3936539e1936636c1fe5e2bd7be11852a64469bbe363cca3db982",
"md5": "656b6f6c1618310adf60f2eca0e57ea2",
"sha256": "9dd9e4e5ffc69b773617d64778817882fc395ac75024b1a92c8ecb648e338170"
},
"downloads": -1,
"filename": "Topsis_Vivek_102203871-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "656b6f6c1618310adf60f2eca0e57ea2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 8986,
"upload_time": "2025-01-19T16:04:04",
"upload_time_iso_8601": "2025-01-19T16:04:04.746177Z",
"url": "https://files.pythonhosted.org/packages/a6/9e/1fe11ff3936539e1936636c1fe5e2bd7be11852a64469bbe363cca3db982/Topsis_Vivek_102203871-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b312a26fa17435134f9fce69a4e2a26f39cfdf2ce9e01251948eea9d2b785f4b",
"md5": "447f701ec29e859d830a74d4423213b7",
"sha256": "68951fa38bb610b9cdba7f4637b6bf55bb271346cb908cbe2e186d5b314c0fde"
},
"downloads": -1,
"filename": "topsis_vivek_102203871-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "447f701ec29e859d830a74d4423213b7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5249,
"upload_time": "2025-01-19T16:04:07",
"upload_time_iso_8601": "2025-01-19T16:04:07.062468Z",
"url": "https://files.pythonhosted.org/packages/b3/12/a26fa17435134f9fce69a4e2a26f39cfdf2ce9e01251948eea9d2b785f4b/topsis_vivek_102203871-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-19 16:04:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "VivekAttri01",
"github_project": "Topsis-Vivek-102203871",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pandas",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "openpyxl",
"specs": []
}
],
"lcname": "topsis-vivek-102203871"
}