Catalog PyPI
PACKAGE EXPLORERView in registry

102203148-topsis

PyPI

A Python package for multi-criteria decision-making using the TOPSIS method.

Versions collected1
Direct dependencies2From release 1.0.0
Last observed20 Oct, 15:08 UTC

README

Version 1.0.0 documentation

TOPSIS Implementation

Overview

This Python package provides a straightforward implementation of the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method for multi-criteria decision-making. With this tool, you can rank alternatives based on multiple criteria using weights and impacts for each criterion.

Features

  • Easy-to-use command-line interface.
  • Supports customizable weights and impacts for criteria.
  • Outputs a ranked list of alternatives with TOPSIS scores.
  • Handles CSV input and output for seamless integration with data workflows.

Usage

Command-Line Interface

To execute TOPSIS, use the following command:

python topsis.py <input_file> <weights> <impacts> <output_file>

Arguments

  • <input_file>: Path to the CSV file containing the input data. The first column should contain alternative names, and subsequent columns should contain numerical criteria values.
  • <weights>: Comma-separated weights for each criterion (e.g., 1,2,3).
  • <impacts>: Comma-separated impacts for each criterion (+ for benefit criteria, - for cost criteria, e.g., +, -, +).
  • <output_file>: Path to the CSV file where the results will be saved.

Example

Suppose you have the following input file (data.csv):

AlternativeCriterion 1Criterion 2Criterion 3
A12501612
A2200208
A33001215
A42751410

To rank the alternatives with weights 1,1,1 and impacts +, +, -, run:

python topsis.py data.csv 1,1,1 +,+,- results.csv

The output (results.csv) will include the TOPSIS scores and ranks:

AlternativeCriterion 1Criterion 2Criterion 3Topsis ScoreRank
A125016120.65472
A22002080.30014
A330012150.82341
A427514100.49213

Input File Requirements

  • The input file must be a CSV with at least three columns.
  • The first column should contain the names of the alternatives.
  • The remaining columns should contain numerical values for criteria.

Output File

The output file will contain the original data along with two additional columns:

  • Topsis Score: The calculated TOPSIS score for each alternative.
  • Rank: The rank of each alternative based on the TOPSIS score (1 = best).

Error Handling

The package validates inputs and raises errors for:

  • Input files with fewer than three columns.
  • Mismatched lengths of weights or impacts compared to the criteria.
  • Invalid impact values (must be + or -).

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

Contact

For questions or feedback, please contact [aryan10767@gmail.com.com].

Downloads & popularity

2downloads
1-day window · source-reported counts19 Oct 2026
1890
2026-07-22: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-22–2026-07-222026-07-23: 3 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-23–2026-07-232026-07-24: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-24–2026-07-242026-07-25: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-25–2026-07-252026-07-27: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-27–2026-07-272026-07-29: 12 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-29–2026-07-292026-07-30: 6 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-30–2026-07-302026-07-31: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-07-31–2026-07-312026-08-01: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-01–2026-08-012026-08-02: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-02–2026-08-022026-08-03: 6 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-03–2026-08-032026-08-04: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-04–2026-08-042026-08-05: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-05–2026-08-052026-08-06: 4 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-06–2026-08-062026-08-07: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-07–2026-08-072026-08-09: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-09–2026-08-092026-08-12: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-12–2026-08-122026-08-13: 4 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-13–2026-08-132026-08-14: 7 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-14–2026-08-142026-08-16: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-16–2026-08-162026-08-17: 9 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-17–2026-08-172026-08-18: 18 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-18–2026-08-182026-08-20: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-20–2026-08-202026-08-22: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-22–2026-08-222026-08-23: 7 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-23–2026-08-232026-08-24: 9 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-24–2026-08-242026-08-28: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-28–2026-08-282026-08-30: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-30–2026-08-302026-08-31: 4 · observed 2026-10-20T21:06:39.7807731Z · period 2026-08-31–2026-08-312026-09-01: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-01–2026-09-012026-09-03: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-03–2026-09-032026-09-05: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-05–2026-09-052026-09-07: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-07–2026-09-072026-09-08: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-08–2026-09-082026-09-09: 4 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-09–2026-09-092026-09-10: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-10–2026-09-102026-09-12: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-12–2026-09-122026-09-13: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-13–2026-09-132026-09-14: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-14–2026-09-142026-09-16: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-16–2026-09-162026-09-17: 3 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-17–2026-09-172026-09-20: 3 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-20–2026-09-202026-09-22: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-22–2026-09-222026-09-24: 3 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-24–2026-09-242026-09-26: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-26–2026-09-262026-09-27: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-27–2026-09-272026-09-29: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-29–2026-09-292026-09-30: 5 · observed 2026-10-20T21:06:39.7807731Z · period 2026-09-30–2026-09-302026-10-01: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-01–2026-10-012026-10-03: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-03–2026-10-032026-10-06: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-06–2026-10-062026-10-07: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-07–2026-10-072026-10-08: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-08–2026-10-082026-10-09: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-09–2026-10-092026-10-13: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-13–2026-10-132026-10-17: 1 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-17–2026-10-172026-10-19: 2 · observed 2026-10-20T21:06:39.7807731Z · period 2026-10-19–2026-10-19
22 Jul19 Oct

pypistats · 57 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1922026-10-20T21:06:39.7807731Z
2026-10-17 – 2026-10-1712026-10-20T21:06:39.7807731Z
2026-10-13 – 2026-10-1312026-10-20T21:06:39.7807731Z
2026-10-09 – 2026-10-0912026-10-20T21:06:39.7807731Z
2026-10-08 – 2026-10-0822026-10-20T21:06:39.7807731Z
2026-10-07 – 2026-10-0712026-10-20T21:06:39.7807731Z
2026-10-06 – 2026-10-0612026-10-20T21:06:39.7807731Z
2026-10-03 – 2026-10-0312026-10-20T21:06:39.7807731Z
2026-10-01 – 2026-10-0112026-10-20T21:06:39.7807731Z
2026-09-30 – 2026-09-3052026-10-20T21:06:39.7807731Z
2026-09-29 – 2026-09-2912026-10-20T21:06:39.7807731Z
2026-09-27 – 2026-09-2722026-10-20T21:06:39.7807731Z
2026-09-26 – 2026-09-2622026-10-20T21:06:39.7807731Z
2026-09-24 – 2026-09-2432026-10-20T21:06:39.7807731Z
2026-09-22 – 2026-09-2212026-10-20T21:06:39.7807731Z
2026-09-20 – 2026-09-2032026-10-20T21:06:39.7807731Z
2026-09-17 – 2026-09-1732026-10-20T21:06:39.7807731Z
2026-09-16 – 2026-09-1612026-10-20T21:06:39.7807731Z
2026-09-14 – 2026-09-1412026-10-20T21:06:39.7807731Z
2026-09-13 – 2026-09-1312026-10-20T21:06:39.7807731Z
2026-09-12 – 2026-09-1212026-10-20T21:06:39.7807731Z
2026-09-10 – 2026-09-1022026-10-20T21:06:39.7807731Z
2026-09-09 – 2026-09-0942026-10-20T21:06:39.7807731Z
2026-09-08 – 2026-09-0822026-10-20T21:06:39.7807731Z
2026-09-07 – 2026-09-0712026-10-20T21:06:39.7807731Z
2026-09-05 – 2026-09-0522026-10-20T21:06:39.7807731Z
2026-09-03 – 2026-09-0312026-10-20T21:06:39.7807731Z
2026-09-01 – 2026-09-0122026-10-20T21:06:39.7807731Z
2026-08-31 – 2026-08-3142026-10-20T21:06:39.7807731Z
2026-08-30 – 2026-08-3022026-10-20T21:06:39.7807731Z
2026-08-28 – 2026-08-2852026-10-20T21:06:39.7807731Z
2026-08-24 – 2026-08-2492026-10-20T21:06:39.7807731Z
2026-08-23 – 2026-08-2372026-10-20T21:06:39.7807731Z
2026-08-22 – 2026-08-2222026-10-20T21:06:39.7807731Z
2026-08-20 – 2026-08-2052026-10-20T21:06:39.7807731Z
2026-08-18 – 2026-08-18182026-10-20T21:06:39.7807731Z
2026-08-17 – 2026-08-1792026-10-20T21:06:39.7807731Z
2026-08-16 – 2026-08-1612026-10-20T21:06:39.7807731Z
2026-08-14 – 2026-08-1472026-10-20T21:06:39.7807731Z
2026-08-13 – 2026-08-1342026-10-20T21:06:39.7807731Z
2026-08-12 – 2026-08-1252026-10-20T21:06:39.7807731Z
2026-08-09 – 2026-08-0922026-10-20T21:06:39.7807731Z
2026-08-07 – 2026-08-0752026-10-20T21:06:39.7807731Z
2026-08-06 – 2026-08-0642026-10-20T21:06:39.7807731Z
2026-08-05 – 2026-08-0552026-10-20T21:06:39.7807731Z
2026-08-04 – 2026-08-0452026-10-20T21:06:39.7807731Z
2026-08-03 – 2026-08-0362026-10-20T21:06:39.7807731Z
2026-08-02 – 2026-08-0222026-10-20T21:06:39.7807731Z
2026-08-01 – 2026-08-0122026-10-20T21:06:39.7807731Z
2026-07-31 – 2026-07-3152026-10-20T21:06:39.7807731Z
2026-07-30 – 2026-07-3062026-10-20T21:06:39.7807731Z
2026-07-29 – 2026-07-29122026-10-20T21:06:39.7807731Z
2026-07-27 – 2026-07-2752026-10-20T21:06:39.7807731Z
2026-07-25 – 2026-07-2522026-10-20T21:06:39.7807731Z
2026-07-24 – 2026-07-2422026-10-20T21:06:39.7807731Z
2026-07-23 – 2026-07-2332026-10-20T21:06:39.7807731Z
2026-07-22 – 2026-07-2222026-10-20T21:06:39.7807731Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.019 Jan 20252

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 15:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:2447c3130b96f46c3c071d2706974d18a29cc4c93a108d0bdb6b90f3953d693a