Skip to main content

A Python implementation of the TOPSIS method.

Project description

Here's a draft for your GitHub README file explaining parts 1 and 2 of your assignment:


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 Distribution

topsis_gazal_102217174-0.2.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.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: topsis_gazal_102217174-0.2.tar.gz
  • Upload date:
  • Size: 3.1 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.2.tar.gz
Algorithm Hash digest
SHA256 0ed2e5646b9e0f79b1783ea349f70a50e177a1c95e6ad1abf12ce43123a51dbf
MD5 29486a35258f86b9a18ff42dd57b70d2
BLAKE2b-256 ffc686c1d8fd50e76a68fa6f273953fa9ed8322ae928507d88f91c4da2d9a08e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Topsis_Gazal_102217174-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04d8b661163e5035ed1297da46fe609a97312b477a3f81a9a8cb7eb7c41da289
MD5 7ca5557d483313417a1e35998e29fe8e
BLAKE2b-256 c2314ba908980e17b48257610a3c45c13a366d5d8d4e185e31a7d9dc9f708316

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