Skip to main content

A Python package implementing TOPSIS method for Multi-Criteria Decision Making (MCDM)

Project description

TOPSIS Python Package

A Python package that implements the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) method. This package helps in solving Multi-Criteria Decision Making (MCDM) problems by ranking alternatives based on multiple criteria.

Installation

pip install topsis-yourname

Usage

The package can be used both as a command-line tool and as a Python module.

Command Line Usage

python -m topsis <InputDataFile> <Weights> <Impacts> <ResultFileName>

Example:

python -m topsis data.xlsx "1,1,1,1,1" "+,-,+,-,+" result.csv

Input File Format

  • Excel file with .xlsx extension
  • First column: Fund/Alternative names
  • 2+ columns: Numerical values for criteria
  • Example:
    Fund Name | Return | Risk | Expense | ...
    Fund A    | 10     | 20   | 30     | ...
    Fund B    | 15     | 25   | 35     | ...
    

Parameters

  • Weights: Comma-separated values of weights (e.g., "1,1,1,1,1")
  • Impacts: Comma-separated +/- signs for maximizing/minimizing criteria (e.g., "+,-,+,-,+")
  • ResultFileName: Output CSV file name

Output

The program will create a CSV file containing the input data along with:

  • Topsis Score
  • Rank

Sample Python Usage

from topsis import topsis

topsis("input.xlsx", [1,1,1,1,1], ['+','-','+','-','+'], "output.csv")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Sarabjeet Singh (ssingh20_be22@thapar.edu)

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_3770-1.0.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

topsis_3770-1.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file topsis_3770-1.0.0.tar.gz.

File metadata

  • Download URL: topsis_3770-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for topsis_3770-1.0.0.tar.gz
Algorithm Hash digest
SHA256 749a89fccb4dcab9f821e4ae34ade4123f38d7fc170872d5c5793cc00ecfaea6
MD5 ceef852d26f56e8e9b5ea2288dc424fb
BLAKE2b-256 87e6c83cfaae99c7338811a9f648681ff5c56fd492d1417c95b48491759d46ea

See more details on using hashes here.

File details

Details for the file topsis_3770-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: topsis_3770-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for topsis_3770-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73bc76e2dbdeb3ca51d403be94b2d630abb84672cc05f46c77dd1d0fe0f5cf07
MD5 c1420b48d3cd29dd96ddd2df68de98a6
BLAKE2b-256 67ceb0e08d9b7d28903bb30da8212b23eab133c8ac008b4b89673846323dfc37

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