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.3.tar.gz (3.0 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.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: topsis_gazal_102217174-0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for topsis_gazal_102217174-0.3.tar.gz
Algorithm Hash digest
SHA256 cb46de3b4ed9e452288f7b3c7cb6a9392aa36d46ba1b38cefce1a7cbe68f2644
MD5 c7a161e0e6ad9472149038f7386e0f54
BLAKE2b-256 0cb9e2a8dee543e4299de7abcb463512222be7825dbc46b1a43c3ef1f5c14595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Topsis_Gazal_102217174-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 01aeeca9aa32d1c35c7f3a472bf1d1037cbc4140b0f9cb6eacca5f533f153fa0
MD5 2d754d12efed4600e2a2b82fa1777aca
BLAKE2b-256 b273a4eaea7718e57c593ce219f22d3168b4ff6b3cb925f601c0e85db53d741e

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