Topsis-Vansh-102203021


NameTopsis-Vansh-102203021 JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/k-vanshhh/topsis_python_package
SummaryA Python package for implementing the TOPSIS decision-making method.
upload_time2025-01-23 19:08:56
maintainerNone
docs_urlNone
authorVansh
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Topsis-Vansh-102203021

A Python package to implement the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** method for multi-criteria decision-making problems.

---

## Features

- Rank alternatives based on multiple criteria.
- Handle positive and negative impacts of criteria.
- Simple to use with CSV input/output.
- Fully customizable weights and impacts.

---

## Installation

Install the package directly from PyPI:

```bash
pip install Topsis-Vansh-102203021
```

---

## How to Use

The package can be used through the command line or imported into a Python script.

### **Command-Line Usage**

The basic syntax for using the package via the command line:

```bash
python -m topsis <input_file> <weights> <impacts> <output_file>
```

#### **Parameters:**
- `input_file`: CSV file containing the decision matrix.
- `weights`: Comma-separated values representing the importance of each criterion (e.g., `1,1,2,3`).
- `impacts`: Comma-separated values representing the impact of each criterion (`+` for positive, `-` for negative).
- `output_file`: Name of the CSV file where the results will be saved.

#### **Example:**

```bash
python -m topsis data.csv "1,1,2,3" "+,+,-,+" result.csv
```

#### **Input File Format:**

The input file must be a CSV file with the following structure:

| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 |
|--------------|-------------|-------------|-------------|-------------|
| A1           | 250         | 16          | 12          | 5           |
| A2           | 200         | 18          | 8           | 3           |
| A3           | 300         | 14          | 16          | 7           |
| A4           | 275         | 17          | 10          | 4           |

- The first column contains alternative names (e.g., A1, A2, etc.).
- From the second column onwards, numeric values for each criterion are provided.

#### **Output File Format:**

The output file will include the input data along with two additional columns:

| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 | Topsis Score | Rank |
|--------------|-------------|-------------|-------------|-------------|--------------|------|
| A1           | 250         | 16          | 12          | 5           | 0.65         | 2    |
| A2           | 200         | 18          | 8           | 3           | 0.45         | 4    |
| A3           | 300         | 14          | 16          | 7           | 0.78         | 1    |
| A4           | 275         | 17          | 10          | 4           | 0.52         | 3    |

---

### **Python Script Usage**

You can also import and use the package in your Python scripts:

```python
from topsis_vansh_102203021 import topsis

topsis(
    input_file="data.csv",
    weights="1,1,2,3",
    impacts="+,+,-,+",
    output_file="result.csv"
)
```

---

## Validation and Error Handling

The package includes robust error handling to ensure correct inputs:

1. **File Not Found:**
   - If the input file does not exist, an appropriate error message is shown.

2. **Invalid Parameters:**
   - The number of weights, impacts, and criteria must match.

3. **Non-Numeric Values:**
   - From the second column onwards, only numeric values are allowed.

4. **Invalid Impacts:**
   - Impacts must be either `+` or `-`.

5. **Minimum Column Requirement:**
   - The input file must have at least three columns.

---

## Example Files

You can test the package using the following example files:

### Input File (`data.csv`):

| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 |
|--------------|-------------|-------------|-------------|-------------|
| A1           | 250         | 16          | 12          | 5           |
| A2           | 200         | 18          | 8           | 3           |
| A3           | 300         | 14          | 16          | 7           |
| A4           | 275         | 17          | 10          | 4           |

### Output File (`result.csv`):

| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 | Topsis Score | Rank |
|--------------|-------------|-------------|-------------|-------------|--------------|------|
| A1           | 250         | 16          | 12          | 5           | 0.65         | 2    |
| A2           | 200         | 18          | 8           | 3           | 0.45         | 4    |
| A3           | 300         | 14          | 16          | 7           | 0.78         | 1    |
| A4           | 275         | 17          | 10          | 4           | 0.52         | 3    |

---

## Author

Developed by **Vansh Kansal (Roll Number: 102203021)**.

For any questions or feedback, please contact **vanshkansal5@example.com**.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/k-vanshhh/topsis_python_package",
    "name": "Topsis-Vansh-102203021",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Vansh",
    "author_email": "vanshkansal5@example.com",
    "download_url": "https://files.pythonhosted.org/packages/ff/96/a53d266030b8ffaaf39a52543009903e6d40b60c934d1438ddcf163aa450/topsis_vansh_102203021-0.1.1.tar.gz",
    "platform": null,
    "description": "# Topsis-Vansh-102203021\r\n\r\nA Python package to implement the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** method for multi-criteria decision-making problems.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Rank alternatives based on multiple criteria.\r\n- Handle positive and negative impacts of criteria.\r\n- Simple to use with CSV input/output.\r\n- Fully customizable weights and impacts.\r\n\r\n---\r\n\r\n## Installation\r\n\r\nInstall the package directly from PyPI:\r\n\r\n```bash\r\npip install Topsis-Vansh-102203021\r\n```\r\n\r\n---\r\n\r\n## How to Use\r\n\r\nThe package can be used through the command line or imported into a Python script.\r\n\r\n### **Command-Line Usage**\r\n\r\nThe basic syntax for using the package via the command line:\r\n\r\n```bash\r\npython -m topsis <input_file> <weights> <impacts> <output_file>\r\n```\r\n\r\n#### **Parameters:**\r\n- `input_file`: CSV file containing the decision matrix.\r\n- `weights`: Comma-separated values representing the importance of each criterion (e.g., `1,1,2,3`).\r\n- `impacts`: Comma-separated values representing the impact of each criterion (`+` for positive, `-` for negative).\r\n- `output_file`: Name of the CSV file where the results will be saved.\r\n\r\n#### **Example:**\r\n\r\n```bash\r\npython -m topsis data.csv \"1,1,2,3\" \"+,+,-,+\" result.csv\r\n```\r\n\r\n#### **Input File Format:**\r\n\r\nThe input file must be a CSV file with the following structure:\r\n\r\n| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 |\r\n|--------------|-------------|-------------|-------------|-------------|\r\n| A1           | 250         | 16          | 12          | 5           |\r\n| A2           | 200         | 18          | 8           | 3           |\r\n| A3           | 300         | 14          | 16          | 7           |\r\n| A4           | 275         | 17          | 10          | 4           |\r\n\r\n- The first column contains alternative names (e.g., A1, A2, etc.).\r\n- From the second column onwards, numeric values for each criterion are provided.\r\n\r\n#### **Output File Format:**\r\n\r\nThe output file will include the input data along with two additional columns:\r\n\r\n| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 | Topsis Score | Rank |\r\n|--------------|-------------|-------------|-------------|-------------|--------------|------|\r\n| A1           | 250         | 16          | 12          | 5           | 0.65         | 2    |\r\n| A2           | 200         | 18          | 8           | 3           | 0.45         | 4    |\r\n| A3           | 300         | 14          | 16          | 7           | 0.78         | 1    |\r\n| A4           | 275         | 17          | 10          | 4           | 0.52         | 3    |\r\n\r\n---\r\n\r\n### **Python Script Usage**\r\n\r\nYou can also import and use the package in your Python scripts:\r\n\r\n```python\r\nfrom topsis_vansh_102203021 import topsis\r\n\r\ntopsis(\r\n    input_file=\"data.csv\",\r\n    weights=\"1,1,2,3\",\r\n    impacts=\"+,+,-,+\",\r\n    output_file=\"result.csv\"\r\n)\r\n```\r\n\r\n---\r\n\r\n## Validation and Error Handling\r\n\r\nThe package includes robust error handling to ensure correct inputs:\r\n\r\n1. **File Not Found:**\r\n   - If the input file does not exist, an appropriate error message is shown.\r\n\r\n2. **Invalid Parameters:**\r\n   - The number of weights, impacts, and criteria must match.\r\n\r\n3. **Non-Numeric Values:**\r\n   - From the second column onwards, only numeric values are allowed.\r\n\r\n4. **Invalid Impacts:**\r\n   - Impacts must be either `+` or `-`.\r\n\r\n5. **Minimum Column Requirement:**\r\n   - The input file must have at least three columns.\r\n\r\n---\r\n\r\n## Example Files\r\n\r\nYou can test the package using the following example files:\r\n\r\n### Input File (`data.csv`):\r\n\r\n| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 |\r\n|--------------|-------------|-------------|-------------|-------------|\r\n| A1           | 250         | 16          | 12          | 5           |\r\n| A2           | 200         | 18          | 8           | 3           |\r\n| A3           | 300         | 14          | 16          | 7           |\r\n| A4           | 275         | 17          | 10          | 4           |\r\n\r\n### Output File (`result.csv`):\r\n\r\n| Alternatives | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 | Topsis Score | Rank |\r\n|--------------|-------------|-------------|-------------|-------------|--------------|------|\r\n| A1           | 250         | 16          | 12          | 5           | 0.65         | 2    |\r\n| A2           | 200         | 18          | 8           | 3           | 0.45         | 4    |\r\n| A3           | 300         | 14          | 16          | 7           | 0.78         | 1    |\r\n| A4           | 275         | 17          | 10          | 4           | 0.52         | 3    |\r\n\r\n---\r\n\r\n## Author\r\n\r\nDeveloped by **Vansh Kansal (Roll Number: 102203021)**.\r\n\r\nFor any questions or feedback, please contact **vanshkansal5@example.com**.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python package for implementing the TOPSIS decision-making method.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/k-vanshhh/topsis_python_package"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f4af1de931be0058b46c5b316842275e70a06de7a0f13477ca4981a2d17c794e",
                "md5": "9ed6bb822b758e0d259519fe82fc163b",
                "sha256": "7446ad4c539abdce9f20cd4a6f40aa9907e81ddaf6ca1b152e0b5cc27c51d31b"
            },
            "downloads": -1,
            "filename": "Topsis_Vansh_102203021-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ed6bb822b758e0d259519fe82fc163b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4174,
            "upload_time": "2025-01-23T19:08:53",
            "upload_time_iso_8601": "2025-01-23T19:08:53.890936Z",
            "url": "https://files.pythonhosted.org/packages/f4/af/1de931be0058b46c5b316842275e70a06de7a0f13477ca4981a2d17c794e/Topsis_Vansh_102203021-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ff96a53d266030b8ffaaf39a52543009903e6d40b60c934d1438ddcf163aa450",
                "md5": "c30d409fe5905ca42b0268aaf713b2e6",
                "sha256": "444a7f56d7cd0911f2e4130160e7e9b031209df1645e79007ff7ab67cf7b7d1c"
            },
            "downloads": -1,
            "filename": "topsis_vansh_102203021-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c30d409fe5905ca42b0268aaf713b2e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3821,
            "upload_time": "2025-01-23T19:08:56",
            "upload_time_iso_8601": "2025-01-23T19:08:56.133231Z",
            "url": "https://files.pythonhosted.org/packages/ff/96/a53d266030b8ffaaf39a52543009903e6d40b60c934d1438ddcf163aa450/topsis_vansh_102203021-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 19:08:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "k-vanshhh",
    "github_project": "topsis_python_package",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "topsis-vansh-102203021"
}
        
Elapsed time: 2.86206s