Metadata-Version: 2.4
Name: seatside
Version: 0.1.0
Summary: Find the best window seat side to watch a sunrise or sunset on any flight.
Project-URL: Homepage, https://github.com/your-org/seatside
Project-URL: Issues, https://github.com/your-org/seatside/issues
Author: Hari
License-Expression: MIT
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: airportsdata>=20250909
Requires-Dist: astral>=3.2
Requires-Dist: geographiclib>=2.1
Requires-Dist: polyline>=2.0.4
Requires-Dist: pydantic>=2.0
Provides-Extra: server
Requires-Dist: fastapi>=0.124; extra == 'server'
Requires-Dist: gunicorn>=23.0; extra == 'server'
Requires-Dist: uvicorn>=0.38; extra == 'server'
Description-Content-Type: text/markdown

# seatside

Find the best window seat side to watch a **sunrise** or **sunset** on any flight.

## Install

```bash
pip install seatside
```

To also run the API server:

```bash
pip install "seatside[server]"
```

## Library usage

```python
from datetime import datetime, timezone
from seatside import predict, PredictIn

result = predict(PredictIn(
    origin="JFK",
    destination="LHR",
    dep_utc=datetime(2025, 6, 21, 22, 0, tzinfo=timezone.utc),
    block_time_min=420,
    event="sunrise",
    aircraft_type="B777",
))

print(result.side)        # "A" (left/window) or "F" (right/window)
print(result.confidence)  # 0.0 – 1.0
print(result.rowBands)    # e.g. ["mid-aft", "forward"]
```

### Error handling

```python
from seatside import SeatsideError

try:
    result = predict(inp)
except SeatsideError as e:
    print(f"Could not compute: {e}")
```

## API server

```bash
uvicorn seatside.server:app --reload
# POST http://localhost:8000/api/predict
```

### Request body

```json
{
  "origin": "JFK",
  "destination": "LHR",
  "dep_utc": "2025-06-21T22:00:00Z",
  "block_time_min": 420,
  "event": "sunrise",
  "aircraft_type": "B777"
}
```

### Response

```json
{
  "side": "A",
  "confidence": 0.83,
  "rowBands": ["mid-aft", "forward"],
  "timeline": [...],
  "polyline": "..."
}
```
