Skip to main content

A Python implementation of the TOPSIS method.

Project description


Topsis Implementation and Python Package

This repository contains the implementation of the Technique for Order Preference by Similarity to Ideal Solution (TOPSIS) as part of an assignment. It includes two components:

  1. Command-Line Python Program
  2. Python Package Published on PyPI

1. Command-Line Python Program

This program calculates the TOPSIS scores and ranks for a given dataset.

How It Works:

  • Input File:
    The input file is a CSV file with three or more columns:

    • The first column contains the names of the objects/variables (e.g., M1, M2, M3, etc.).
    • The remaining columns contain numeric data.
  • Output File:
    The output file includes all columns from the input file with two additional columns:

    • Topsis Score
    • Rank

Features:

  • Handles exceptions for:
    • Incorrect input format.
    • Missing files.
    • Non-numeric values.
  • Ensures weights and impacts are correctly formatted.
  • Validates the consistency of input dimensions (number of weights, impacts, and columns).

Usage:

Run the program through the command line:

python <program.py> <InputDataFile> <Weights> <Impacts> <ResultFileName>

Example:

python Topsis-Gazal-102217174.py data.csv "1,1,1,2" "+,+,-,+" result.csv

2. Python Package on PyPI

https://pypi.org/project/Topsis-Gazal-102217174/

User Guide:

  • Install the package using pip:
    pip install Topsis-Gazal-102217174
    
  • Run the TOPSIS calculation from the command line:
    Topsis-Gazal-102217174 <InputDataFile> <Weights> <Impacts> <ResultFileName>
    
    Example:
    Topsis-Gazal-102217174 data.csv "1,1,1,2" "+,+,-,+" result.csv
    

Testing:

The package was thoroughly tested by installing it from PyPI and running multiple test cases.


Resources and References


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

Topsis_Gazal_102217174-0.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file Topsis_Gazal_102217174-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Topsis_Gazal_102217174-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe816bebf87e78f9cab9719928013b9199c4fc159eaeaf63f783fdf7c61318c6
MD5 c80c20bf42795fca05767a27035c8eeb
BLAKE2b-256 cec8c6784b089d39d9a44c1c8730675c750b7962101fce227052f290ae30546a

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