Skip to main content

A Python package to calculate TOPSIS rankings

Project description

Topsis-Package

Topsis-Package is a Python library for implementing the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method for multi-criteria decision analysis. It simplifies ranking and decision-making based on criteria weights and performance data.


Installation

Install the package directly from PyPI:

pip install topsis-teena-102217049

Usage

Input

Prepare a CSV file with the following structure:

  • The first row contains column headers (criteria names).
  • The first column contains the names of alternatives (e.g., products or options).
  • The remaining columns are numeric values representing the performance scores for each criterion.

Example Input CSV (data.csv):

Alternative, Criterion 1, Criterion 2, Criterion 3, Criterion 4
Option A, 250, 16, 12, 5
Option B, 200, 22, 8, 6
Option C, 300, 18, 15, 4
Option D, 275, 20, 14, 7

Running the Package

To execute, you will need:

  • Path to the input CSV file.
  • A comma-separated string of weights (e.g., "0.4,0.3,0.2,0.1").
  • A comma-separated string of impacts (e.g., "+,+,-,-").

Example Code:

topsis input.csv "0.4,0.3,0.2,0.1" "+,+,-,-" result.csv

Input parameters

  • input_file = "data.csv"
  • weights = "0.4,0.3,0.2,0.1"
  • impacts = "+,+,-,-"

Output

The package will create a new CSV file with an additional column, "Topsis Score", and the final "Rank" for each alternative.

Example Output:

Alternative, Criterion 1, Criterion 2, Criterion 3, Criterion 4, Topsis Score, Rank
Option A, 250, 16, 12, 5, 0.78, 2
Option B, 200, 22, 8, 6, 0.56, 4
Option C, 300, 18, 15, 4, 0.84, 1
Option D, 275, 20, 14, 7, 0.64, 3

Features

  • Simple Input Format: Provide your data in CSV format.
  • Customizable Weights and Impacts: Define criteria importance and type (beneficial or non-beneficial).
  • Automated Output: Generates scores and ranks for all alternatives.

Requirements

This package requires Python 3.7 or higher. Install any missing dependencies using pip.


Author

Developed by Teena Sapra.


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

topsis_teena_102217049-1.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topsis_teena_102217049-1.0.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file topsis_teena_102217049-1.0.2.tar.gz.

File metadata

  • Download URL: topsis_teena_102217049-1.0.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.5

File hashes

Hashes for topsis_teena_102217049-1.0.2.tar.gz
Algorithm Hash digest
SHA256 46e335c68a2955eb99084fe33d745afaed6975ecbfe9d86665f24df4453dd5bd
MD5 7409105a2ded47dc5f1a5fc180653d30
BLAKE2b-256 67b75349733b82516049ecd605f5adcc2376a97599df5b795154ec7bd460aa46

See more details on using hashes here.

File details

Details for the file topsis_teena_102217049-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_teena_102217049-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da98849d70e3ab1a9a3d735f915fe6afeb71ba587fca0486691e3b694640edcb
MD5 0fb347071cf3ab8cb2b1eab0938327a9
BLAKE2b-256 c5a687a8c483574a76bf1ee0357879270bc0adef08713b6a6d0b756ddc7ca3c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page