topsis-krishna


Nametopsis-krishna JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/yourusername/topsis-package
SummaryA Python implementation of the TOPSIS decision-making method
upload_time2025-08-10 19:22:03
maintainerNone
docs_urlNone
authorKrishna Arora
requires_python>=3.6
licenseMIT
keywords topsis decision-making multi-criteria ranking optimization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TOPSIS Program

## What is this program?

This Python program helps in decision-making by ranking different options based on multiple criteria. It uses a method called **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** to calculate a score for each option and rank them from best to worst.

## What does it do?

The program takes data about different options, with several criteria for each option, and ranks them. You can specify the importance of each criterion (called **weights**) and whether you want the criteria to be a benefit (+) or a cost (-). After running the program, it gives you a rank for each option based on the calculations.

## How does it work?

1. **Input File**: You provide a file that lists the options and their values for each criterion.
2. **Weights**: You specify how important each criterion is.
3. **Impacts**: You specify if the criterion is a benefit (like higher values are better) or a cost (like lower values are better).
4. **Output File**: The program calculates a score for each option, adds the rank, and saves the results to a new file.

## Requirements

Make sure you have Python installed, and you will need to install a library called `pandas` to read and write the data files. You can install it by running:

```bash
pip install pandas
1. Prepare the Files
Input File: This is a CSV file with the data you want to process. It must have at least three columns: the first one for the name of the options (e.g., M1, M2, M3), and the others for the values of different criteria.

Example of Input Data (101556-data.csv):

Object	Criterion1	Criterion2	Criterion3
M1	100	200	300
M2	150	250	350
M3	120	220	330
Weights and Impacts: These are provided as comma-separated values. The weights tell you how important each criterion is, and the impacts tell you if a higher value is better (use +) or if a lower value is better (use -).
2. Running the Program
Run the program from the command line by typing:

bash
Copy
Edit
python <YourFileName.py> <InputDataFile> <Weights> <Impacts> <ResultFileName>
<YourFileName.py>: The name of your Python program (e.g., 101556.py).
<InputDataFile>: The input data file (e.g., 101556-data.csv).
<Weights>: The importance of each criterion (e.g., "1,1,1,2").
<Impacts>: Whether each criterion is a benefit (+) or a cost (-) (e.g., "+,+,-,+").
<ResultFileName>: The name of the output file where the results will be saved (e.g., 101556-result.csv).
Example Command:
bash
Copy
Edit
python 101556.py 101556-data.csv "1,1,1,2" "+,+,-,+" 101556-result.csv
This will read the 101556-data.csv, calculate the Topsis scores, and save the result in 101556-result.csv.

What Does the Program Do?
Read Data: The program reads the input file and checks if it has at least 3 columns.
Normalize: It normalizes the values so that they can be compared fairly.
Apply Weights: It multiplies the values by the specified weights.
Ideal Solutions: The program identifies the best (ideal) and worst (negative-ideal) solutions.
Calculate Scores: It calculates a score for each option based on how close it is to the ideal solution.
Rank: It ranks the options based on the scores.
Error Handling
The program checks for:

Correct number of inputs (file names, weights, impacts).
If the file exists.
If the input data file has valid numbers and enough columns.
If the number of weights and impacts matches the number of criteria.
If the impacts are valid (either + or -).
Example of Output
After running the program, it will produce an output file that looks like this:

Object	Criterion1	Criterion2	Criterion3	Topsis Score	Rank
M1	100	200	300	0.75	1
M2	150	250	350	0.80	2
M3	120	220	330	0.70	3
The Topsis Score tells you how good each option is, and the Rank shows the best to worst alternatives.

Contributing
Feel free to make improvements or fix bugs by forking the repository and submitting a pull request.

License
This project is open source under the MIT License.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/topsis-package",
    "name": "topsis-krishna",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "topsis, decision-making, multi-criteria, ranking, optimization",
    "author": "Krishna Arora",
    "author_email": "Krishna Arora <your.email@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/ee/ca/bedeaec1d06beeb7a02e1bec6c514991daf974ff94795dfad9e9fd3c6a3a/topsis_krishna-1.0.1.tar.gz",
    "platform": null,
    "description": "# TOPSIS Program\r\n\r\n## What is this program?\r\n\r\nThis Python program helps in decision-making by ranking different options based on multiple criteria. It uses a method called **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** to calculate a score for each option and rank them from best to worst.\r\n\r\n## What does it do?\r\n\r\nThe program takes data about different options, with several criteria for each option, and ranks them. You can specify the importance of each criterion (called **weights**) and whether you want the criteria to be a benefit (+) or a cost (-). After running the program, it gives you a rank for each option based on the calculations.\r\n\r\n## How does it work?\r\n\r\n1. **Input File**: You provide a file that lists the options and their values for each criterion.\r\n2. **Weights**: You specify how important each criterion is.\r\n3. **Impacts**: You specify if the criterion is a benefit (like higher values are better) or a cost (like lower values are better).\r\n4. **Output File**: The program calculates a score for each option, adds the rank, and saves the results to a new file.\r\n\r\n## Requirements\r\n\r\nMake sure you have Python installed, and you will need to install a library called `pandas` to read and write the data files. You can install it by running:\r\n\r\n```bash\r\npip install pandas\r\n1. Prepare the Files\r\nInput File: This is a CSV file with the data you want to process. It must have at least three columns: the first one for the name of the options (e.g., M1, M2, M3), and the others for the values of different criteria.\r\n\r\nExample of Input Data (101556-data.csv):\r\n\r\nObject\tCriterion1\tCriterion2\tCriterion3\r\nM1\t100\t200\t300\r\nM2\t150\t250\t350\r\nM3\t120\t220\t330\r\nWeights and Impacts: These are provided as comma-separated values. The weights tell you how important each criterion is, and the impacts tell you if a higher value is better (use +) or if a lower value is better (use -).\r\n2. Running the Program\r\nRun the program from the command line by typing:\r\n\r\nbash\r\nCopy\r\nEdit\r\npython <YourFileName.py> <InputDataFile> <Weights> <Impacts> <ResultFileName>\r\n<YourFileName.py>: The name of your Python program (e.g., 101556.py).\r\n<InputDataFile>: The input data file (e.g., 101556-data.csv).\r\n<Weights>: The importance of each criterion (e.g., \"1,1,1,2\").\r\n<Impacts>: Whether each criterion is a benefit (+) or a cost (-) (e.g., \"+,+,-,+\").\r\n<ResultFileName>: The name of the output file where the results will be saved (e.g., 101556-result.csv).\r\nExample Command:\r\nbash\r\nCopy\r\nEdit\r\npython 101556.py 101556-data.csv \"1,1,1,2\" \"+,+,-,+\" 101556-result.csv\r\nThis will read the 101556-data.csv, calculate the Topsis scores, and save the result in 101556-result.csv.\r\n\r\nWhat Does the Program Do?\r\nRead Data: The program reads the input file and checks if it has at least 3 columns.\r\nNormalize: It normalizes the values so that they can be compared fairly.\r\nApply Weights: It multiplies the values by the specified weights.\r\nIdeal Solutions: The program identifies the best (ideal) and worst (negative-ideal) solutions.\r\nCalculate Scores: It calculates a score for each option based on how close it is to the ideal solution.\r\nRank: It ranks the options based on the scores.\r\nError Handling\r\nThe program checks for:\r\n\r\nCorrect number of inputs (file names, weights, impacts).\r\nIf the file exists.\r\nIf the input data file has valid numbers and enough columns.\r\nIf the number of weights and impacts matches the number of criteria.\r\nIf the impacts are valid (either + or -).\r\nExample of Output\r\nAfter running the program, it will produce an output file that looks like this:\r\n\r\nObject\tCriterion1\tCriterion2\tCriterion3\tTopsis Score\tRank\r\nM1\t100\t200\t300\t0.75\t1\r\nM2\t150\t250\t350\t0.80\t2\r\nM3\t120\t220\t330\t0.70\t3\r\nThe Topsis Score tells you how good each option is, and the Rank shows the best to worst alternatives.\r\n\r\nContributing\r\nFeel free to make improvements or fix bugs by forking the repository and submitting a pull request.\r\n\r\nLicense\r\nThis project is open source under the MIT License.\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python implementation of the TOPSIS decision-making method",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://github.com/yourusername/topsis-package#readme",
        "Homepage": "https://github.com/yourusername/topsis-package",
        "Issues": "https://github.com/yourusername/topsis-package/issues",
        "Repository": "https://github.com/yourusername/topsis-package"
    },
    "split_keywords": [
        "topsis",
        " decision-making",
        " multi-criteria",
        " ranking",
        " optimization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5b0fbefd6546cd5a3f414396e8776585aa635924acd97edbfa0ead5f8add8955",
                "md5": "5321f7a3fac22d0a078169183961b596",
                "sha256": "bf334b6c5fe6168ef02304dc1f47504463f3a91634b310444b4b02dc2cbb02c8"
            },
            "downloads": -1,
            "filename": "topsis_krishna-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5321f7a3fac22d0a078169183961b596",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7470,
            "upload_time": "2025-08-10T19:22:01",
            "upload_time_iso_8601": "2025-08-10T19:22:01.631779Z",
            "url": "https://files.pythonhosted.org/packages/5b/0f/befd6546cd5a3f414396e8776585aa635924acd97edbfa0ead5f8add8955/topsis_krishna-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "eecabedeaec1d06beeb7a02e1bec6c514991daf974ff94795dfad9e9fd3c6a3a",
                "md5": "1f68b508f4a987892fc54ebe2e735595",
                "sha256": "d2a3dc47c13b0c8ae3e5781afab9796a666307b4bdf554214d85cbc00309a3b6"
            },
            "downloads": -1,
            "filename": "topsis_krishna-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1f68b508f4a987892fc54ebe2e735595",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 9167,
            "upload_time": "2025-08-10T19:22:03",
            "upload_time_iso_8601": "2025-08-10T19:22:03.492553Z",
            "url": "https://files.pythonhosted.org/packages/ee/ca/bedeaec1d06beeb7a02e1bec6c514991daf974ff94795dfad9e9fd3c6a3a/topsis_krishna-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-10 19:22:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "topsis-package",
    "github_not_found": true,
    "lcname": "topsis-krishna"
}
        
Elapsed time: 1.24188s