Metadata-Version: 2.4
Name: topsis-backend
Version: 0.1.0
Summary: Flask API for TOPSIS CSV processing and email delivery
Author: Topsis contributors
License-Expression: MIT
Keywords: topsis,flask,mcda,api
Classifier: Framework :: Flask
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: flask>=3.0.0
Requires-Dist: flask-cors>=4.0.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: prod
Requires-Dist: gunicorn>=21.0.0; extra == "prod"

# topsis-backend

Flask API that accepts a CSV, runs the `topsis` CLI, and emails the result.

## Install

```bash
pip install topsis-backend
```

With Gunicorn for production:

```bash
pip install "topsis-backend[prod]"
```

## Configuration

Set environment variables (e.g. in `.env`):

- `MAIL_ID` — sender email
- `APP_PASSWORD` — app password for SMTP
- `PORT` — dev server port (default `5000`)
- `TOPSIS_UPLOAD_DIR` — upload directory (default `./uploads` under current working directory)
- `TOPSIS_STATIC_ROOT` — optional directory to serve static frontend files (e.g. path to `frontend`)

The host machine must have the `topsis` command available on `PATH`.

## Run

```bash
topsis-backend
```

Or with Gunicorn:

```bash
gunicorn -w 2 -b 0.0.0.0:5000 "topsis_backend.app:create_app()"
```

## Build / publish

```bash
python -m build
python -m twine upload dist/*
```
