Skip to main content

A command line python package to implement TOPSIS

Project description

Topsis-Sukhmanpreet-102317112


What is TOPSIS?

TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) is a multi-criteria decision-making method. It ranks a set of alternatives by identifying the solution that is closest to the Ideal Best and farthest from the Ideal Worst.


Installation

You can install this package via PyPi:

Bash pip install Topsis-Sukhmanpreet-102317112

Usage The package can be executed directly from the command line:

Bash python <program.py> <InputDataFile> <Weights> <Impacts> <OutputResultFileName>

Example Bash python topsis.py data.csv "1,1,1,1,1" "+,+,+,+,+" result.csv


Input Requirements

File Format: The input file must be a .csv.

Structure: The file must contain three or more columns.

Data Type: From the 2nd column to the last, all values must be numeric.

Parameters:

  • Weights: Must be numeric and separated by commas.
  • Impacts: Must be either + (for maximization) or - (for minimization), separated by commas.
  • Matching: The number of weights, impacts, and numeric columns must be identical.

Error Handling

  • The package includes robust validation and will show appropriate messages for:
  • Incorrect number of parameters.
  • "File Not Found" exceptions.
  • Non-numeric values in criteria columns.
  • Mismatch between weights, impacts, and criteria count.

Output

  • The result is saved as a new .csv file containing all original data plus two additional columns:

Topsis Score: The calculated performance score.

Rank: The final ranking of the alternatives.


License

© 2026 Sukhmanpreet Singh

This repository is licensed under the MIT license. See LICENSE for details.

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_sukhmanpreet_102317112-1.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

topsis_sukhmanpreet_102317112-1.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file topsis_sukhmanpreet_102317112-1.1.0.tar.gz.

File metadata

File hashes

Hashes for topsis_sukhmanpreet_102317112-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a17bb7764dc13477d24ddaef2597729bac5a3b3f677f4488722633bb8d2973e7
MD5 345fe622807ce2d0c19e0871fb1548f8
BLAKE2b-256 20fd07b4e16881356251cb5af2f08554f20b12aa8b43ac55c9bff9ad427b3c0c

See more details on using hashes here.

File details

Details for the file topsis_sukhmanpreet_102317112-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_sukhmanpreet_102317112-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2856985ac91eab6cfec21ad974f5ed8eac5885fa1898b9aac0c66bf00632b7c4
MD5 1459e500837bc6ed700e9a7e53da0b32
BLAKE2b-256 1ddf86e7e78dabcfb4e776de1d20cba171e61bcda3238bcec8053484ee18dedc

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