Metadata-Version: 2.4
Name: kamera
Version: 1.0.1
Summary: Realtime webcam streaming and video processing with a FastAPI UI
Author-email: Mert Cobanov <mertcobanov@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/cobanov/kamera
Project-URL: Repository, https://github.com/cobanov/kamera
Project-URL: Issues, https://github.com/cobanov/kamera/issues
Keywords: camera,opencv,fastapi,streaming,webcam
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.115.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: opencv-python>=4.9.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: uvicorn>=0.30.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: pytest>=8.2.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Dynamic: license-file

# Kamera

Kamera is a small Python app that streams your webcam to a local web page and
lets you control video effects in real time.

## Features

- Live webcam stream in your browser
- Camera selection (`camera_index`)
- Rotation (`0`, `90`, `180`, `270`)
- Brightness control (`0.1` to `2.0`)
- Grayscale and mirror toggles
- Filters: `none`, `sepia`, `blur`, `edges`
- Simple HTTP API for automation

## Requirements

- Python `3.10+`

## Install

```bash
pip install kamera
```

If `pip` is not available in your shell, use:

```bash
uv tool run --from kamera kamera
```

## Run

```bash
kamera
```

Open: `http://127.0.0.1:4141`

## How to Use

1. Start `kamera`
2. Open the web UI
3. Pick a camera index if needed (`0` is usually default camera)
4. Change controls and click **Apply**
5. Click **Reset** to restore defaults

## API

### `GET /video_feed`

Returns the MJPEG stream.

### `GET /api/settings`

Returns current settings.

### `POST /api/settings`

Updates one or more settings.

Example:

```bash
curl -X POST http://127.0.0.1:4141/api/settings \
  -H "content-type: application/json" \
  -d '{"camera_index":1,"rotate":90,"brightness":1.3,"grayscale":true,"mirror":false,"filter_name":"sepia"}'
```

### `POST /api/settings/reset`

Resets all settings to defaults.

```bash
curl -X POST http://127.0.0.1:4141/api/settings/reset
```

## Development

```bash
uv sync --extra dev
uv run pytest
uv run kamera
```

## License

MIT
