Topsis-Pulkit-102303800 1.0.3__tar.gz → 1.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.4
2
+ Name: Topsis-Pulkit-102303800
3
+ Version: 1.0.9
4
+ Summary: TOPSIS CLI tool for Multi-Criteria Decision Making (MCDM) with CSV and Excel support
5
+ Home-page: https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800
6
+ Author: Pulkit Goyal
7
+ Project-URL: Source Code, https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800
8
+ Project-URL: Bug Tracker, https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800/issues
9
+ Requires-Python: >=3.6
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: pandas
13
+ Requires-Dist: numpy
14
+ Requires-Dist: openpyxl
15
+ Dynamic: author
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: license-file
20
+ Dynamic: project-url
21
+ Dynamic: requires-dist
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # Topsis-Pulkit-102303800
26
+
27
+ A command-line Python implementation of the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** algorithm used in **Multi-Criteria Decision Making (MCDM)**.
28
+
29
+ ![Python](https://img.shields.io/badge/Python-3.6+-blue.svg)
30
+ ![License](https://img.shields.io/badge/License-MIT-green.svg)
31
+ ![PyPI](https://img.shields.io/pypi/v/Topsis-Pulkit-102303800)
32
+
33
+ ---
34
+
35
+ ## 📌 Features
36
+
37
+ - Supports **CSV** and **Excel (.xlsx)** input files
38
+ - Implements full TOPSIS ranking method
39
+ - Validates user input and handles common errors
40
+ - Produces decision scores and ranks
41
+ - Lightweight and easy-to-use CLI tool
42
+
43
+ ---
44
+
45
+ ## 🧮 About TOPSIS
46
+
47
+ TOPSIS ranks alternatives based on their distance from the **ideal best** and **ideal worst** solutions.
48
+
49
+ ---
50
+
51
+ ## usage
52
+
53
+ topsis <inputfile> <weights> <impacts> <outputfile>
54
+
55
+
56
+ ---
57
+
58
+ ## 🚀 Installation
59
+
60
+ ```bash
61
+ pip install Topsis-Pulkit-102303800
62
+
63
+ ---
64
+
65
+ ##Author
66
+
67
+ Pulkit Goyal
68
+
69
+
@@ -0,0 +1,45 @@
1
+ # Topsis-Pulkit-102303800
2
+
3
+ A command-line Python implementation of the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** algorithm used in **Multi-Criteria Decision Making (MCDM)**.
4
+
5
+ ![Python](https://img.shields.io/badge/Python-3.6+-blue.svg)
6
+ ![License](https://img.shields.io/badge/License-MIT-green.svg)
7
+ ![PyPI](https://img.shields.io/pypi/v/Topsis-Pulkit-102303800)
8
+
9
+ ---
10
+
11
+ ## 📌 Features
12
+
13
+ - Supports **CSV** and **Excel (.xlsx)** input files
14
+ - Implements full TOPSIS ranking method
15
+ - Validates user input and handles common errors
16
+ - Produces decision scores and ranks
17
+ - Lightweight and easy-to-use CLI tool
18
+
19
+ ---
20
+
21
+ ## 🧮 About TOPSIS
22
+
23
+ TOPSIS ranks alternatives based on their distance from the **ideal best** and **ideal worst** solutions.
24
+
25
+ ---
26
+
27
+ ## usage
28
+
29
+ topsis <inputfile> <weights> <impacts> <outputfile>
30
+
31
+
32
+ ---
33
+
34
+ ## 🚀 Installation
35
+
36
+ ```bash
37
+ pip install Topsis-Pulkit-102303800
38
+
39
+ ---
40
+
41
+ ##Author
42
+
43
+ Pulkit Goyal
44
+
45
+
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.4
2
+ Name: Topsis-Pulkit-102303800
3
+ Version: 1.0.9
4
+ Summary: TOPSIS CLI tool for Multi-Criteria Decision Making (MCDM) with CSV and Excel support
5
+ Home-page: https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800
6
+ Author: Pulkit Goyal
7
+ Project-URL: Source Code, https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800
8
+ Project-URL: Bug Tracker, https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800/issues
9
+ Requires-Python: >=3.6
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: pandas
13
+ Requires-Dist: numpy
14
+ Requires-Dist: openpyxl
15
+ Dynamic: author
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: license-file
20
+ Dynamic: project-url
21
+ Dynamic: requires-dist
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # Topsis-Pulkit-102303800
26
+
27
+ A command-line Python implementation of the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** algorithm used in **Multi-Criteria Decision Making (MCDM)**.
28
+
29
+ ![Python](https://img.shields.io/badge/Python-3.6+-blue.svg)
30
+ ![License](https://img.shields.io/badge/License-MIT-green.svg)
31
+ ![PyPI](https://img.shields.io/pypi/v/Topsis-Pulkit-102303800)
32
+
33
+ ---
34
+
35
+ ## 📌 Features
36
+
37
+ - Supports **CSV** and **Excel (.xlsx)** input files
38
+ - Implements full TOPSIS ranking method
39
+ - Validates user input and handles common errors
40
+ - Produces decision scores and ranks
41
+ - Lightweight and easy-to-use CLI tool
42
+
43
+ ---
44
+
45
+ ## 🧮 About TOPSIS
46
+
47
+ TOPSIS ranks alternatives based on their distance from the **ideal best** and **ideal worst** solutions.
48
+
49
+ ---
50
+
51
+ ## usage
52
+
53
+ topsis <inputfile> <weights> <impacts> <outputfile>
54
+
55
+
56
+ ---
57
+
58
+ ## 🚀 Installation
59
+
60
+ ```bash
61
+ pip install Topsis-Pulkit-102303800
62
+
63
+ ---
64
+
65
+ ##Author
66
+
67
+ Pulkit Goyal
68
+
69
+
@@ -6,4 +6,6 @@ Topsis_Pulkit_102303800.egg-info/SOURCES.txt
6
6
  Topsis_Pulkit_102303800.egg-info/dependency_links.txt
7
7
  Topsis_Pulkit_102303800.egg-info/entry_points.txt
8
8
  Topsis_Pulkit_102303800.egg-info/requires.txt
9
- Topsis_Pulkit_102303800.egg-info/top_level.txt
9
+ Topsis_Pulkit_102303800.egg-info/top_level.txt
10
+ topsis_pulkit_102303800/__init__.py
11
+ topsis_pulkit_102303800/topsis.py
@@ -0,0 +1 @@
1
+ topsis_pulkit_102303800
@@ -0,0 +1,25 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="Topsis-Pulkit-102303800",
5
+ version="1.0.9",
6
+ author="Pulkit Goyal",
7
+ description="TOPSIS CLI tool for Multi-Criteria Decision Making (MCDM) with CSV and Excel support",
8
+ long_description=open("README.md").read(),
9
+ long_description_content_type="text/markdown",
10
+
11
+ url="https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800",
12
+ project_urls={
13
+ "Source Code": "https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800",
14
+ "Bug Tracker": "https://github.com/Pulkitgoyal10/Topsis-Pulkit-102303800/issues",
15
+ },
16
+
17
+ packages=find_packages(),
18
+ install_requires=["pandas", "numpy", "openpyxl"],
19
+ entry_points={
20
+ 'console_scripts': [
21
+ 'topsis=topsis_pulkit_102303800.topsis:main',
22
+ ],
23
+ },
24
+ python_requires='>=3.6',
25
+ )
@@ -0,0 +1 @@
1
+ from .topsis import main
@@ -0,0 +1,66 @@
1
+ import os
2
+ import sys
3
+ import pandas as pd
4
+ import numpy as np
5
+ import argparse
6
+
7
+
8
+ def topsis(input_file, weights, impacts, output_file):
9
+ if not os.path.exists(input_file):
10
+ sys.exit("Error: File not found")
11
+
12
+ if not (input_file.endswith('.csv') or input_file.endswith('.xlsx')):
13
+ sys.exit("Error: Only CSV and XLSX files allowed")
14
+
15
+ df = pd.read_csv(input_file) if input_file.endswith('.csv') else pd.read_excel(input_file)
16
+
17
+ if df.shape[1] < 3:
18
+ sys.exit("Error: File must have 3+ columns")
19
+
20
+ data = df.iloc[:, 1:].values
21
+
22
+ try:
23
+ data = data.astype(float)
24
+ except:
25
+ sys.exit("Error: Data columns must be numeric")
26
+
27
+ weights = list(map(float, weights.split(',')))
28
+ impacts = impacts.split(',')
29
+
30
+ if len(weights) != data.shape[1] or len(impacts) != data.shape[1]:
31
+ sys.exit("Error: Number of weights and impacts must equal number of columns")
32
+
33
+ if any(i not in ['+', '-'] for i in impacts):
34
+ sys.exit("Error: Impacts must be + or -")
35
+
36
+ norm = data / np.sqrt((data**2).sum(axis=0))
37
+ weighted = norm * weights
38
+
39
+ ideal_best = np.max(weighted, axis=0)
40
+ ideal_worst = np.min(weighted, axis=0)
41
+
42
+ for i, imp in enumerate(impacts):
43
+ if imp == '-':
44
+ ideal_best[i], ideal_worst[i] = ideal_worst[i], ideal_best[i]
45
+
46
+ dist_best = np.sqrt(((weighted - ideal_best)**2).sum(axis=1))
47
+ dist_worst = np.sqrt(((weighted - ideal_worst)**2).sum(axis=1))
48
+
49
+ score = dist_worst / (dist_best + dist_worst)
50
+
51
+ df["Topsis Score"] = score
52
+ df["Rank"] = score.argsort()[::-1] + 1
53
+
54
+ df.to_csv(output_file, index=False)
55
+ print("TOPSIS calculation complete. Output saved.")
56
+
57
+
58
+ def main():
59
+ parser = argparse.ArgumentParser(description="TOPSIS Decision Making Tool")
60
+ parser.add_argument("input_file")
61
+ parser.add_argument("weights")
62
+ parser.add_argument("impacts")
63
+ parser.add_argument("output_file")
64
+ args = parser.parse_args()
65
+
66
+ topsis(args.input_file, args.weights, args.impacts, args.output_file)
@@ -1,15 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: Topsis-Pulkit-102303800
3
- Version: 1.0.3
4
- Summary: CLI-based TOPSIS implementation
5
- Author: Pulkit Goyal
6
- Requires-Python: >=3.6
7
- License-File: LICENSE
8
- Requires-Dist: pandas
9
- Requires-Dist: numpy
10
- Requires-Dist: openpyxl
11
- Dynamic: author
12
- Dynamic: license-file
13
- Dynamic: requires-dist
14
- Dynamic: requires-python
15
- Dynamic: summary
@@ -1,17 +0,0 @@
1
- # Topsis-Pulkit-102303800
2
-
3
- A Python CLI tool implementing the TOPSIS method.
4
-
5
- ## Usage
6
-
7
- topsis <inputfile> <weights> <impacts> <outputfile>
8
-
9
- Example:
10
-
11
- topsis data.csv "1,1,1,2" "+,+,-,+" result.csv
12
-
13
- ## Input Rules
14
- - File must be .csv or .xlsx
15
- - Minimum 3 columns
16
- - First column is label
17
- - Remaining columns numeric
@@ -1,15 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: Topsis-Pulkit-102303800
3
- Version: 1.0.3
4
- Summary: CLI-based TOPSIS implementation
5
- Author: Pulkit Goyal
6
- Requires-Python: >=3.6
7
- License-File: LICENSE
8
- Requires-Dist: pandas
9
- Requires-Dist: numpy
10
- Requires-Dist: openpyxl
11
- Dynamic: author
12
- Dynamic: license-file
13
- Dynamic: requires-dist
14
- Dynamic: requires-python
15
- Dynamic: summary
@@ -1,16 +0,0 @@
1
- from setuptools import setup, find_packages
2
-
3
- setup(
4
- name="Topsis-Pulkit-102303800",
5
- version="1.0.3",
6
- author="Pulkit Goyal",
7
- description="CLI-based TOPSIS implementation",
8
- packages=find_packages(), # 🔥 this auto-detects folder
9
- install_requires=["pandas", "numpy", "openpyxl"],
10
- entry_points={
11
- 'console_scripts': [
12
- 'topsis=topsis_pulkit_102303800.topsis:main',
13
- ],
14
- },
15
- python_requires='>=3.6',
16
- )