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). 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 Distribution

topsis_gazal_102217174-0.4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

topsis_gazal_102217174-0.4-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file topsis_gazal_102217174-0.4.tar.gz.

File metadata

  • Download URL: topsis_gazal_102217174-0.4.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for topsis_gazal_102217174-0.4.tar.gz
Algorithm Hash digest
SHA256 274d213ec3e26f5614dd0fda096f7bb04163c7be0a236fcd8fab5a5d48469af3
MD5 bba7287a752dcf6bc7a35576ba6bd0bb
BLAKE2b-256 e56d1eda88a9859b2160620c520344e44f2708b87aa8f4cb8f9f9e81cd7b93a1

See more details on using hashes here.

File details

Details for the file topsis_gazal_102217174-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_gazal_102217174-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 df5276b9d5c8948c8387b54ef5a468890b000141f403ea12a018c6a6898bb250
MD5 16b37557012e91077057890fc3e0d941
BLAKE2b-256 454844aa9f9dc97a8e08d259a7fe0625b0db202690c56bbf25fb01ef80355fa1

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