A Python package for TOPSIS implementation
Project description
TOPSIS-Vikas-102303451
Project Description
TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) is a multi-criteria decision analysis method. It evaluates alternatives based on their geometric distance to the ideal best value and the ideal worst value.
🔄 System Flowchart
graph LR
A[Data Input<br>(CSV/Excel)] --> B[Data Validation<br>(Check Numeric/Weights)]
B --> C[Normalization &<br>Weight Application]
C --> D[Ideal Solution<br>(Best & Worst)]
D --> E[Ranking &<br>Result Generation]
style A fill:#e1f5fe,stroke:#01579b,stroke-width:2px
style B fill:#fff9c4,stroke:#fbc02d,stroke-width:2px
style C fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
style D fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
style E fill:#ffebee,stroke:#c62828,stroke-width:2px
This project implements TOPSIS in Python and provides three interfaces:
- Command Line Interface (CLI): For quick local usage.
- Python Package: Reusable library for your scripts.
- Web Service: A user-friendly web app to upload data and get results via email.
🚀 Live Web Service
The web application is deployed and accessible at:
🛠️ System Architecture
Workflow Diagram
graph TD
A[User] -->|Uploads File .csv/.xlsx| B(Web Interface)
B -->|Inputs Weights & Impacts| C{Flask Backend}
C -->|Validates Data| D[Topsis Logic Module]
D -->|Calculates Scores| E[Result Generator]
E -->|Generates Result File| F[Email Service]
F -->|Sends Attachment| A
E -->|Direct Download| A
How TOPSIS Works (Mathematics)
- Normalization: Normalize the decision matrix so that each criterion is comparable.
- Weighting: Multiply the normalized matrix by the weights of each criterion.
- Ideal Best & Worst: Identify the ideal best ($V^+$) and ideal worst ($V^-$) values for each column.
- For Benefit (+): Max value is best, Min is worst.
- For Cost (-): Min value is best, Max is worst.
- Separation Measures: Calculate Euclidean distance of each alternative from $V^+$ and $V^-$.
- Score Calculation: $P_i = \frac{S_i^-}{S_i^+ + S_i^-}$.
- Ranking: Sort alternatives by score in descending order.
📦 Installation & Usage
1. Python Package
Install from PyPi:
pip install Topsis-Vikas-102303451
Use in your code:
from topsis_vikas import topsis
# topsis(input_file, weights, impacts, output_file)
topsis("data.csv", "1,1,1,1", "+,+,+,-", "output.csv")
2. Command Line Interface
topsis data.csv "1,1,1,1" "+,+,+,-" result.csv
- Weights: Comma-separated (e.g.,
1,1,1,1) - Impacts: Comma-separated
+or-(e.g.,+,+,+,-)
💻 Web Application
Features
- Modern UI: Clean, responsive interface using CSS Gradients and Glassmorphism.
- Auto-Analysis: Automatically detects the number of criteria in your file.
- Email Delivery: Results delivered directly to your inbox.
Tech Stack
- Frontend: HTML5, CSS3, JavaScript (Fetch API)
- Backend: Python, Flask
- Data Processing: Pandas, NumPy
- Deployment: Vercel
Screenshots
👨💻 Author
Vikas Verma
- Roll Number: 102303451
- Email: vverma_be22@thapar.edu
- GitHub: vikasverma
Constructed with ❤️ for the Thapar Institute of Engineering & Technology.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topsis_vikas_102303451-1.0.0.tar.gz.
File metadata
- Download URL: topsis_vikas_102303451-1.0.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c012313608b6466d743519289c93014d5a6cd34690f2d9eb793387572b009f18
|
|
| MD5 |
44f7c1eef8af2a372b58d7660e6ffa74
|
|
| BLAKE2b-256 |
22222a0c411756c7565a9ed7107acc0bac287ff3e65665f34c40121f59663534
|
File details
Details for the file topsis_vikas_102303451-1.0.0-py3-none-any.whl.
File metadata
- Download URL: topsis_vikas_102303451-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f827a4f6f227a8b3139e3539034f15ddc0c1c82844dae8a4439972a7298a46ca
|
|
| MD5 |
89d47d21a379716f910ec50136380256
|
|
| BLAKE2b-256 |
ccc311664e52d81328fe56ab21d5563fc69786146e4d25350fd45ea2735967a8
|