Skip to main content

TOPSIS implementation as a Python package

Project description

USER MANUAL

TOPSIS – Arihan (102303750)


1. Overview

topsis-arihan-102303750 is a Python command-line tool that implements the
Technique for Order Preference by Similarity to Ideal Solution (TOPSIS).

TOPSIS is a Multi-Criteria Decision Making (MCDM) technique used to rank a set of alternatives based on multiple evaluation criteria.
The alternative closest to the ideal best solution and farthest from the ideal worst solution is ranked highest.

This package is developed for Project-1 (UCS633).


2. System Requirements

  • Python version 3.7 or higher
  • Operating System: Windows / macOS / Linux
  • Python packages: numpy, pandas

3. Installation

Install the package from PyPI using pip:

pip install topsis-arihan-102303750

After installation, the command topsis becomes available in the terminal.

4. Command-Line Usage

4.1 General Syntax

topsis <InputDataFile> <Weights> <Impacts> <OutputFile>

4.2 Description of Parameters

InputDataFile
CSV file containing the alternatives and criteria.

Weights
Comma-separated numeric values representing the importance of each criterion.

Impacts
Comma-separated symbols indicating the nature of each criterion:
+ → Benefit criterion (higher value is better)
- → Cost criterion (lower value is better)

OutputFile
Name of the CSV file where results will be saved.


5. Example Usage

5.1 Input File (data.csv)

Student,Marks,Attendance(%),Assignments,ProjectScore
S1,85,92,80,78
S2,78,88,85,82
S3,90,95,92,90
S4,72,80,75,70
S5,88,90,88,85
S6,65,75,70,68
S7,82,85,80,76
S8,95,98,96,94
S9,70,82,78,72
S10,86,89,84,81

The first column is treated as an identifier (Student ID).
All remaining columns must contain numeric criteria.


5.2 Weights and Impacts Used

Weights:
3,1,2,4

Impacts:
+,-,+,+


5.3 Command Executed

topsis data.csv "3,1,2,4" "+,-,+,+" output.csv

6. Output Description

The output file contains:

  • Original data
  • Topsis Score (closeness coefficient)
  • Rank (1 indicates the best alternative)

6.1 Output File (output.csv)

Student,Marks,Attendance(%),Assignments,ProjectScore,Topsis Score,Rank
S1,85,92,80,78,0.49,6
S2,78,88,85,82,0.50,5
S3,90,95,92,90,0.81,2
S4,72,80,75,70,0.19,9
S5,88,90,88,85,0.69,3
S6,65,75,70,68,0.13,10
S7,82,85,80,76,0.42,7
S8,95,98,96,94,0.87,1
S9,70,82,78,72,0.20,8
S10,86,89,84,81,0.57,4

7. Assumptions and Constraints

  • Input CSV must contain only numeric values after the first column.
  • Number of weights and impacts must match the number of criteria.
  • Higher TOPSIS score implies better ranking.
  • Missing or categorical values are not supported.

8. Error Handling

The program performs validation and displays appropriate error messages for:

  • Incorrect number of command-line arguments.
  • File not found.
  • Non-numeric values in criteria columns.
  • Mismatch in number of criteria, weights, and impacts.
  • Invalid impact symbols (only + and - allowed).

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_arihan_102303750-0.0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

topsis_arihan_102303750-0.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file topsis_arihan_102303750-0.0.3.tar.gz.

File metadata

  • Download URL: topsis_arihan_102303750-0.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for topsis_arihan_102303750-0.0.3.tar.gz
Algorithm Hash digest
SHA256 c098b918634fe412238a137c057700fcb1b347e383196659697c2f1bddc38ac8
MD5 17824f43c7c371cf826d9cffdbf02ea1
BLAKE2b-256 3a536bfc09f0657ae5392e9ba7756f6cb24f574e53fe66d58ee8fb981478dc58

See more details on using hashes here.

File details

Details for the file topsis_arihan_102303750-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_arihan_102303750-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cac4a32834f7a46065bebf85894e5005eea8e4753b96876ea5d441bfa38b93e5
MD5 5582a139a3edd585a9ee37c4c9a8f638
BLAKE2b-256 a54dbfdeb4b053dae18693eed2c51d0d367a7ccbc318e632947b0a4939c2b2b4

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