Metadata-Version: 2.2
Name: topsis-payal-102203203
Version: 0.0.2
Summary: TOPSIS mcdm
Author-email: Payal <ppayal_be22@thapar.edu>
License: Copyright (c) 2018 The Python Packaging Authority
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/pypa/sampleproject
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# TOPSIS Command-Line Tool

## Project Description

The **TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)** command-line tool implements the TOPSIS method, which is used in multi-criteria decision-making (MCDM) problems. The method ranks alternatives based on their relative closeness to the ideal solution. This package allows users to perform TOPSIS analysis on a dataset provided in a CSV format, specifying weights and impacts for each criterion.

## Features

- Normalizes the data to compare different criteria on the same scale.
- Applies weights to different criteria.
- Identifies the ideal and worst solutions for each criterion based on impact direction (`+` for benefit, `-` for cost).
- Ranks the alternatives based on their closeness to the ideal solution.

## Installation

1. Clone the repository or download the script.
2. Ensure you have the necessary Python dependencies installed:

   ```bash
   pip install numpy pandas

# How to Use

## Command-Line Usage

The tool can be run via the command line and accepts four arguments:

1. **input_file**: Path to the input CSV file containing the data.
2. **weights**: Comma-separated list of weights for each criterion.
3. **impacts**: Comma-separated list of impacts (`+` or `-`) for each criterion.
4. **output_file**: Path to save the output CSV file with the rankings and performance scores.

## Input Data Format

The input CSV file must have the following structure:

| ID  | Criterion 1 | Criterion 2 | Criterion 3 | ... |
|-----|-------------|-------------|-------------|-----|
| 1   | value       | value       | value       | ... |
| 2   | value       | value       | value       | ... |
| ... | ...         | ...         | ...         | ... |

- The first column (`ID`) should be an identifier for the alternatives.
- The subsequent columns should represent the criteria for each alternative.
- The number of criteria should be at least two.

## Running the Script

Once the input CSV file is ready, you can run the script via the command line:

```bash
python topsis.py input_file.csv "0.4,0.3,0.3" "+,+,-" output_file.csv

```
- `input_file.csv`: Path to the input CSV file containing the data.
- `"0.4,0.3,0.3"`: A comma-separated list of weights for each criterion.
- `"+,+,-"`: A comma-separated list of impacts for each criterion (`+` indicates a benefit, `-` indicates a cost).
- `output_file.csv`: Path to save the output CSV file with the rankings and performance scores.

## Output

The output file (`output_file.csv`) will contain the following columns:

- `ID`: The alternative identifier.
- The original criteria columns.
- `Score`: The performance score for each alternative.
- `Rank`: The rank based on the performance score (1 being the best).

## Example

For an input CSV file:

| ID  | Criterion 1 | Criterion 2 | Criterion 3 |
|-----|-------------|-------------|-------------|
| 1   | 7           | 8           | 6           |
| 2   | 9           | 7           | 8           |
| 3   | 6           | 5           | 7           |

And the following arguments:

```bash
python topsis.py input_file.csv "0.5,0.3,0.2" "+,-,+"
