semvec/pypi-packages huggingface dataset:
tdatasuite 1.0.0
A toolkit for Telegram data collection and analytics
Requires Python: <=3.12.8

# TDataSuite
TDataSuite: A toolkit for Telegram data collection and analytics

## Python version

```bash
python --version # Python 3.12.8
```

## Install tdatasuite
```bash
pip install tdatasuite
```

## Usage

1. **Initialize the Client**:
   ```python
   from pyrogram import Client
   from tdatasuite import TDataSuite

   app = Client(
    "testsuite_bot",
    api_id="2040",
    api_hash="b18441a1ff607e10a989891a5462e627",
   )
   
   tdata = TDataSuite(app)
   ```  

2. **Extract Messages**:
   ```python
   await tdata.collect_data("-1000000000000", days=7)  # Get data from the last 7 days
   ```

3. **Save Data**:
   The extracted data is automatically saved in a CSV file named `data_username.csv`.

## Example

```python
from pyrogram import Client

from tdatasuite import TDataSuite

app = Client(
    "testsuite_bot",
    api_id="2040",
    api_hash="b18441a1ff607e10a989891a5462e627",
)

tdata = TDataSuite(app)


async def main():
    await app.start()
    await tdata.collect_data("@admin", 1) # Get data from the last 1 day by default
    await app.stop()


if __name__ == "__main__":
    app.run(main())
```

## Example with Command
You can also use the /tdata command in private messages to save messages from a specific chat

```python
from pyrogram import Client, idle, filters
from tdatasuite import TDataSuite

app = Client(
    "testsuite_bot",
    api_id="2040",
    api_hash="b18441a1ff607e10a989891a5462e627",
)

tdata = TDataSuite(app)


@app.on_message(filters.private & filters.regex(r"^/tdata\s+(.+)"))
async def handler_message(client, message):
    if message.from_user.id == client.me.id:
        chat_id = message.text.split()[1]
        await tdata.collect_data(chat_id, 1)


async def main():
    await app.start()
    await idle()
    await app.stop()


if __name__ == "__main__":
    app.run(main())
```
How it works:
Send a private message to the bot with the command /tdata <chat_id> (e.g., /tdata @admin)

## Output

CSV file:
```csv
row,full_name,user_id,user_name,message,date
1, John Doe, 123456789, johndoe, Hello everyone!, 2025-01-20 10:34:56
2, Jane Smith, 987654321, janesmith, How's it going?, 2025-01-25 14:35:10
3, Alex Johnson, 555555555, alexj, Don't forget the meeting!, 2025-02-01 09:12:45
4, Sarah Brown, 111111111, sarahb, See you all tomorrow., 2025-02-10 18:30:15
```
topsis-Pranav-102203059 1.2
A Python package to implement the TOPSIS method
Requires Python: >=3.6

# TOPSIS Implementation Package

This package implements the **Technique for Order Preference by Similarity to Ideal Solution (TOPSIS)**, a multi-criteria decision-making method widely used in ranking and evaluation problems.

---

## What is TOPSIS?

TOPSIS is a decision-making method that ranks alternatives based on their closeness to the ideal solution and distance from the worst solution. It is commonly used in scenarios involving multiple criteria and alternatives.

---

## Installation

To install the package from PyPI, run the following command:

```bash
pip install topsis-Pranav-102203059
```
---
## Usage

After installation, you can use the package via the command line.

### Command Line Syntax:

```bash
topsis <InputDataFile> <Weights> <Impacts> <ResultFileName>
```

### Parameters:
- **`<InputDataFile>`**: Path to the input file (e.g., `data.csv` or `data.xlsx`) containing the dataset.
  - The file must have:
    - At least 3 columns.
    - First column for the names/identifiers (e.g., alternatives like M1, M2, etc.).
    - Remaining columns with numeric values for criteria.

- **`<Weights>`**: Comma-separated weights for the criteria (e.g., `"1,1,1,2"`).

- **`<Impacts>`**: Comma-separated impacts for the criteria. Use `+` for positive impact and `-` for negative impact (e.g., `"+,+,-,+"`).

- **`<ResultFileName>`**: Path for the output file to save the result (e.g., `result.csv`).

---

### Example Usage:

1. **Input File**: `102203059-data.xlsx`
   ```
   Fund Name, P1, P2, P3, P4, P5
   M1, 0.84, 0.71, 6.7, 42.1, 12.59
   M2, 0.91, 0.83, 7.0, 31.7, 10.11
   M3, 0.79, 0.62, 4.8, 46.7, 13.23
   ```

2. **Command**:
   ```bash
   topsis 102203059-data.xlsx "1,1,1,1,2" "+,+,-,+,+" 102203059-result.csv
   ```

3. **Output File**: `102203059-result.csv`
   ```
   Fund Name, P1, P2, P3, P4, P5, Topsis Score, Rank
   M1, 0.84, 0.71, 6.7, 42.1, 12.59, 0.7523, 1
   M2, 0.91, 0.83, 7.0, 31.7, 10.11, 0.6321, 2
   M3, 0.79, 0.62, 4.8, 46.7, 13.23, 0.5809, 3
   ```

---

## How It Works

1. **Normalization**:
   - The criteria values are normalized using vector normalization

2. **Weight Application**:
   - Each normalized value is multiplied by its respective weight

3. **Determine Ideal Best and Worst**:
   - **Ideal Best (A⁺)**:
     - Maximum value for positive impact (`+`).
     - Minimum value for negative impact (`-`).
   - **Ideal Worst (A⁻)**:
     - Minimum value for positive impact (`+`).
     - Maximum value for negative impact (`-`).

4. **Calculate Distances**:
   - Euclidean distance from the ideal best and worst

5. **Calculate TOPSIS Score**:
   - Calculate closeness to the ideal solution

6. **Rank Alternatives**:
   - Rank alternatives based on the TOPSIS score in descending order.

---

## Dependencies

Ensure the following Python libraries are installed:
- `pandas`
- `numpy`